Skip to content

fix: stop MarkerLayer wrap loops on a non-finite camera - #2242

Closed
AzazelSensei wants to merge 1 commit into
fleaflet:masterfrom
AzazelSensei:fix/marker-layer-nonfinite-camera
Closed

fix: stop MarkerLayer wrap loops on a non-finite camera#2242
AzazelSensei wants to merge 1 commit into
fleaflet:masterfrom
AzazelSensei:fix/marker-layer-nonfinite-camera

Conversation

@AzazelSensei

Copy link
Copy Markdown

Fixes #2240

#2178 only rejects a non-finite Marker.point. A NaN camera still makes Rect.overlaps return true for every world copy, so the wrap loops never stop.

I skip MarkerLayer when the camera isn't finite, and I skip wrapping a marker if its projected point isn't finite either. There's also a 30-shift cap like workAcrossWorlds, so a future never-culls bug throws instead of taking the process down.

Widget test: rotate(double.nan), then pump() has to return.

fleaflet#2178 only rejects a non-finite Marker.point. A NaN camera still
makes Rect.overlaps return true for every world copy, so the wrap
loops never stop.

Skip the layer when the camera is not finite, skip wrapping a
marker whose projected point is not finite, and cap world shifts
the same way workAcrossWorlds already does.
@JaffaKetchup

Copy link
Copy Markdown
Member

Thanks for your contribution!

The root issue should now be fixed, please ping me if it isn't. And as previously discussed, this is a partial patch which doesn't solve the root issue. That's not to say that this isn't a good idea, as it is defensive against similar bugs in future, but I am not completely happy with the implementation either.

So for now, I'm going to close this PR. But please feel free to contribute again in future!

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.

A non-finite camera makes MarkerLayer's world-wrap loops unbounded (OOM/ANR) — _projectPoints guards the points but nothing guards the camera

2 participants