Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Port line-pattern underscaling/overscaling fix #16359

Closed
chloekraw opened this issue Mar 31, 2020 · 1 comment
Closed

Port line-pattern underscaling/overscaling fix #16359

chloekraw opened this issue Mar 31, 2020 · 1 comment
Labels
archived Archived because of inactivity GL JS parity For feature parity with Mapbox GL JS

Comments

@chloekraw
Copy link
Contributor

Ticket for developers and customers: mapbox/mapbox-gl-js#9394
GL-JS PR: mapbox/mapbox-gl-js#9266
WIP branch: 0572a16


The change fixes overscaling/underscaling of line pattern as well as render differences between different physical pixel ratio sprites when used as line patterns.

Videos on mobile

Visual differences

The behavior is changed to match the following:

  1. When the line pattern fits on a line smaller than its own resolution, we downscale while keeping the aspect ratio at integer zoom level
  2. When the line pattern fits on a line larger than its own resolution, we upscale while keeping the aspect ratio at integer zoom level
  3. When the line pattern has different pixel ratio attributes (1x, 2x, 3x...), the pattern screenspace resolution should remain stable (e.g. the physical resolution shouldn't impact the size at which the pattern is rendered but instead increase the quality of the visual while keeping its logical resolution)

The current behavior does not account for 1. and 3.

Before

underscale-2x@2x
underscale-2x@2x-before
underscale-3x@2x
underscale-3x@2x-before
overscale-1x@2x
overscale-1x@2x-before
overscale-2x@2x
overscale-2x@2x-before

After

underscale-2x@2x
underscale-2x@2x-after
underscale-3x@2x
underscale-3x@2x-after
overscale-1x@2x
overscale-1x@2x-after
overscale-2x@2x
overscale-2x@2x-after

cc/ @karimnaaji

@chloekraw chloekraw added the GL JS parity For feature parity with Mapbox GL JS label Apr 23, 2020
@stale stale bot added the archived Archived because of inactivity label Nov 9, 2020
@stale
Copy link

stale bot commented Nov 9, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

No branches or pull requests

1 participant