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 pointer location not updated in edit mode #1352

Closed
wants to merge 1 commit into from

Conversation

tomi-bigpi
Copy link

Currently useShapeEvents.pointerEventHandler sets killed = true when pointer events are received over a shape that's in edit mode. However, this also stops pointer_move events, and that means that inputs.currentPagePoint will be wrong while you move into or in a shape. The fallout, and the main issue for us, is that this breaks the checks for canScroll / bounds?.containsPoint(app.inputs.currentPagePoint) and canScroll isn't honored and we can't scroll content in certain situations.

Change Type

  • patch — Bug Fix

  • minor — New Feature

  • major — Breaking Change

  • dependencies — Dependency Update (publishes a patch release, for devDependencies use internal)

  • documentation — Changes to the documentation only (will not publish a new version)

  • tests — Changes to any testing-related code only (will not publish a new version)

  • internal — Any other changes that don't affect the published package (will not publish a new version)

Test Plan

  1. Put shape that has scrollable content into edit mode
  2. Use scrollwheel = content scrolls as it should
  3. Move the mouse outside the shape and use the scrollwheel (to move the canvas and get a desired bit of the shape into view better, for example)
  4. Move the pointer back inside the shape
  5. Use scrollwheel - canvas scrolls since the app thinks the current position is outside (right on the border) of the shape where it last updated it

Release Notes

  • Fix pointer location not updated in edit mode after moving cursor out of shape and back into shape area

@huppy-bot huppy-bot bot added the bugfix Bug fix label May 11, 2023
@vercel
Copy link

vercel bot commented May 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
examples ✅ Ready (Inspect) Visit Preview May 11, 2023 7:15pm
tldraw-docs-staging ✅ Ready (Inspect) Visit Preview May 11, 2023 7:15pm

@steveruizok
Copy link
Collaborator

This is a good one Tomi! We're currently waiting on getting a CLA so that we can take contributions from the community, so I can't merge this one. However that may take a few more days, and this seems like an impactful change for you, I will gladly do the little legal dance and make a separate PR that implements the same thing. 🙃

@steveruizok
Copy link
Collaborator

Closing but only for the above reason. Thank you @tomi-bigpi !

steveruizok added a commit that referenced this pull request May 15, 2023
…1378)

This PR is entirely unrelated to
#1352.

### Change Type

- [x] `minor` — New Feature

### Release Notes

- Fix a bug where the pointer location would not update when moving the
pointer over an editing shape.
@tomi-bigpi
Copy link
Author

@steveruizok No worries, I've got a custom patch on that via pnpm patch, so no rush.

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

Successfully merging this pull request may close these issues.

None yet

2 participants