Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

[bug] Pointer position is incorrect if Tldraw is drawing in a scrolling container #206

Closed
pengx17 opened this issue Apr 30, 2022 · 3 comments · Fixed by tldraw/tldraw#706
Labels
bug Something isn't working

Comments

@pengx17
Copy link
Contributor

pengx17 commented Apr 30, 2022

Please see this minimum repro https://stackblitz.com/edit/vitejs-vite-tspw4n?file=src%2FApp.jsx&terminal=dev

I guess the issue is that the getPoint function in https://github.com/tldraw/tldraw/blob/4aa8547a8e856dc40db2ddbc48161fbf7d675b42/packages/core/src/inputs.ts#L385-L390 does not take scroll container into consideration.

Kapture.2022-04-30.at.15.14.13.mp4
@pengx17 pengx17 added the bug Something isn't working label Apr 30, 2022
@steveruizok
Copy link
Contributor

That's a good catch: I would have expected the resize observer to pick that up.

@pengx17
Copy link
Contributor Author

pengx17 commented May 6, 2022

Hi @steveruizok , are you willing accepting a PR to fix this issue? If yes, I will take some time this week :D.

@milo-
Copy link
Contributor

milo- commented May 18, 2022

@pengx17 I'd love a PR to fix this 🤩

steveruizok referenced this issue in tldraw/tldraw Jun 1, 2022
…g g container (#706)

* fix: Pointer position is incorrect if Tldraw is drawing in a scrolling container

fix https://github.com/tldraw/tldraw/issues/661

* Add example for scrolling

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
@TodePond TodePond transferred this issue from tldraw/tldraw May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants