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

Port line-pattern underscaling/overscaling fix #16359

Closed

Description

@chloekraw

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

Activity

  1. added
    GL JS parity
    on Apr 23, 2020
  2. added
    archived
    on Nov 9, 2020
  3. stale commented on Nov 9, 2020

    @stale

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GL JS parityarchived

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions