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

Add test to prevent future gesture detection regressions #1584

Conversation

rorystephenson
Copy link
Contributor

Recently a change was made to move the TileLayer backgroundColor option to become an option of FlutterMap. This accidentally fixed an issue where gestures would stop working when going beyond a TileLayer's max zoom because FlutterMap's gesture detectors' HitTestBehaviour is the default deferToChild and when above a TileLayer's maxZoom potentially there would be no hit-testable children of FlutterMap.

Moving the color option to FlutterMap means that there is always a ColoredBox child widget which is hit testable. To avoid accidentally breaking hit testing again in the future this commit adds a test which ensures it always works.

In passing I made TileLayer only wrap its tiles in a ColoredBox widget if the user defines a backgroundColor (which is deprecated).

Recently a change was made to move the TileLayer backgroundColor option
to become an option of FlutterMap. This accidentally fixed an issue
where gestures would stop working when going beyond a TileLayer's max
zoom because FlutterMap's gesture detectors' HitTestBehaviour is the
default deferToChild and when above a TileLayer's maxZoom potentially
there would be no hit-testable children of FlutterMap.

Moving the color option to FlutterMap means that there is always a
ColoredBox child widget which is hit testable. To avoid accidentally
breaking hit testing again in the future this commit adds a test which
ensures it always works.

In passing I made TileLayer only wrap its tiles in a ColoredBox widget
if the user defines a backgroundColor (which is deprecated).
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

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

accidentally fixed an issue

😂 I think you mean 'intentionally' 😉

LGTM, thanks for the contribution. More tests are always appriciated!

@JaffaKetchup JaffaKetchup changed the title Add test to ensure gestures always work Add test to prevent future gesture detection regressions Jul 13, 2023
@JaffaKetchup JaffaKetchup merged commit 3f18982 into fleaflet:master Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants