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

[core] Update ZoomHistory.lastInteger{Zoom,Time} if different from floor zoom - #9760

Merged
brunoabinader merged 2 commits into
masterfrom
test-api-zoom-history
Aug 22, 2017
Merged

brunoabinader merged 2 commits into
masterfrom
test-api-zoom-history

Conversation

@brunoabinader

Copy link
Copy Markdown
Contributor

Imagine the following scenario:

  1. Initial map zoom is set to 1.0
  • ZoomHistory.first is triggered, causing ZoomHistory.lastIntegerZoom to be 1.
  1. Map zoom is now set to 0.0
  • ZoomHistory.lastIntegerZoom is still 1.
  1. Map zoom is now set to 0.5
  • ZoomHistory.lastIntegerZoom should be now 0, but it remains as 1.

This happens because we don't update ZoomHistory.lastInteger{Zoom,Time} when the floor value of the last and current zooms are the same. However, we cannot assume that the last integer zoom remains the same (like the scenario above).

This is currently causing some rendering artifacts (blurry lines) due to the algorithm we use for evaluating the line-dasharray property here:

(previous) actual diff expected
actual diff expected

The difference might be subtle, but causes our line-dasharray render tests to fail in #9689 when reusing the map object due to the previous erroneous state in ZoomHistory.

@brunoabinader
brunoabinader force-pushed the test-api-zoom-history branch from 6b77020 to 67f5602 Compare August 14, 2017 15:24

@jfirebaugh jfirebaugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't look right to me -- it's going to result in lastIntegerZoomTime getting set to now on any zoom change. The intent is that lastIntegerZoomTime changes only when crossing an integer zoom level.

@brunoabinader

Copy link
Copy Markdown
Contributor Author

The intent is that lastIntegerZoomTime changes only when crossing an integer zoom level.

True indeed - thanks for pointing that out @jfirebaugh. I'll rework the patch to enforce we won't be changing lastIntegerZoomTime unnecessarily.

@brunoabinader brunoabinader added ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold and removed ✓ ready for review labels Aug 21, 2017
@brunoabinader
brunoabinader force-pushed the test-api-zoom-history branch from 67f5602 to 5f22408 Compare August 21, 2017 17:42
@brunoabinader brunoabinader changed the title [core] Always update ZoomHistory.lastIntegerZoom [core] Update ZoomHistory.lastInteger{Zoom,Time} if different from floor zoom Aug 21, 2017
@brunoabinader

Copy link
Copy Markdown
Contributor Author

Modified the patch behavior to comply with @jfirebaugh's comments on preserving lastIntegerZoomTime - my bad as I did not properly considered the continuous mode behavior on that one 🙇‍♂️

@brunoabinader brunoabinader added ✓ ready for review and removed ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels Aug 21, 2017
@brunoabinader
brunoabinader merged commit 224e9e6 into master Aug 22, 2017
@brunoabinader
brunoabinader deleted the test-api-zoom-history branch August 22, 2017 07:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Core The cross-platform C++ core, aka mbgl tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants