Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shaky sprites on scrollZoom #7558

Merged
merged 1 commit into from
Nov 7, 2018
Merged

fix shaky sprites on scrollZoom #7558

merged 1 commit into from
Nov 7, 2018

Conversation

mollymerp
Copy link
Contributor

Sprites wiggle around on scroll zoom because map.isZooming() always returns false due to the order of operations in the render loop, because it checks ScrollZoomHandler.isActive() which is set back to false by the time it is called here

zooming: this.isZooming(),

and painter.options.zooming is used to choose the texture filter

tile.imageAtlasTexture.bind(isSDF || painter.options.rotating || painter.options.zooming || iconScaled || iconTransformed ?
gl.LINEAR : gl.NEAREST, gl.CLAMP_TO_EDGE);

I don't have many good ideas on how to test this 😬

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

Copy link
Contributor

@ChrisLoer ChrisLoer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks right to me. It does seem like it'll be hard to write an automated test that's not too contrived to be useful.

I'm having trouble manually testing this though, how did you do it? I've been trying scroll animations while looking at highway shields, and I think I see the change, but honestly it's subtle enough I could be imagining it.

@mollymerp
Copy link
Contributor Author

for posterity: the shakyness is hard to see on retina screens, but very visible on lower-resolution devices.

@mollymerp mollymerp merged commit 081863d into master Nov 7, 2018
mollymerp added a commit that referenced this pull request Nov 7, 2018
pirxpilot pushed a commit to pirxpilot/mapbox-gl-js that referenced this pull request Jun 15, 2019
pirxpilot pushed a commit to pirxpilot/mapbox-gl-js that referenced this pull request Jun 16, 2019
pirxpilot pushed a commit to pirxpilot/mapbox-gl-js that referenced this pull request Jun 18, 2019
@mourner mourner deleted the is-zooming-fix branch August 1, 2019 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants