Skip to content

fix: node misplacement when clicking quickly after zooming#12375

Open
atchisson wants to merge 1 commit into
openstreetmap:developfrom
atchisson:issue-9156
Open

fix: node misplacement when clicking quickly after zooming#12375
atchisson wants to merge 1 commit into
openstreetmap:developfrom
atchisson:issue-9156

Conversation

@atchisson

@atchisson atchisson commented May 22, 2026

Copy link
Copy Markdown

Fixes #9156

Problem

When zooming in or out, quickly clicking to place a node would position
it far from where the user actually clicked.

Fix

Replaced pointerLocGetter(d3_event) calls with
context.map().mouse(d3_event) in pointerdown, pointerup, and
pointermove.

map.mouse() uses _getMouseCoords, a closure over
supersurface's base bounding rect captured once at startup (before
any CSS transform), which stays permanently consistent with
projection.invert() regardless of any in-flight zoom transforms.
The original pointerLocGetter is kept as a fallback.

Video preview of the fix :

Enregistrement.de.lecran.2026-05-22.142737.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A bug - let's fix this!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking too quickly after zooming causes the node to be incorrectly placed

2 participants