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: correct display of StrokePattern.solid at high zoom levels #1871

Merged
merged 1 commit into from
May 6, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Changed the way to display the solid style segments (polygon and polyline), in order to fix a display side-effect.
  • Some performance test should be performed to see if we're not significantly impacted, as we added a pre-computation step with potentially many allocations.
  • That fix works only for lines, not for areas.

Impacted files

  • polygon_layer/painter.dart: now using the new SolidPixelHiker for solid style display
  • polyline_layer/painter.dart: now using the new SolidPixelHiker for solid style display
  • pixel_hiker.dart: new SolidPixelHiker class

Screenshots

Example on high zoom level: the paths are unstable beyond a certain threshold, and as a side effect some painting are corrupted (in that case, the border).

before after
Screenshot_1714549210 Screenshot_1714555249

Impacted files:
* `polygon_layer/painter.dart`: now using the new `SolidPixelHiker` for solid style display
* `polyline_layer/painter.dart`: now using the new `SolidPixelHiker` for solid style display
* `pixel_hiker.dart`: new `SolidPixelHiker` class
@josxha
Copy link
Contributor

josxha commented May 6, 2024

Thanks for the pull request, lgtm!

@JaffaKetchup JaffaKetchup changed the title fix: 1864 - correct display of solid style in high zoom levels fix: correct display of PolylinePattern.solid at high zoom levels May 6, 2024
@JaffaKetchup JaffaKetchup changed the title fix: correct display of PolylinePattern.solid at high zoom levels fix: correct display of StrokePattern.solid at high zoom levels May 6, 2024
@JaffaKetchup JaffaKetchup merged commit 3e8cd97 into fleaflet:master May 6, 2024
7 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @josxha for your review!

We still need:

  • to create a new issue about polygon areas not being correctly displayed in high zoom levels (25+) because of flutter limitations (path coordinates > 64M), and I have an algorithm for that
  • to check the impact on performances - on one hand we allocate memory for pre-computations, on the other hand we display smaller polylines and polygon areas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] v7-beta: Polyline becomes distorted & invisible (but remains interactive) when zoomed far in
3 participants