Content-Length: 328071 | pFad | http://github.com/tldraw/tldraw/pull/5026

CD Implement one finger panning in pen mode by gekiclaws · Pull Request #5026 · tldraw/tldraw · GitHub
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

Implement one finger panning in pen mode #5026

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gekiclaws
Copy link

@gekiclaws gekiclaws commented Nov 29, 2024

Describe what your pull request does.
This PR introduces changes to improve the behavior of pen mode and touch interactions:

  • When pen mode is active:

    • Pen input (e.g., stylus): Enables drawing functionality as expected.
    • Finger input: Allows one-finger panning for touch gestures.
  • Preserved Existing Functionality:

    • Middle mouse panning, spacebar panning, and eraser functionality remain unchanged.
    • Behavior for inputs outside of pen mode is not impacted.

Addresses #4816.


Change type

  • bugfix
  • improvement
  • feature
  • api
  • other

Test plan

  1. Activate pen mode.
  2. Use a pen (stylus) to draw and confirm drawing functionality works as expected.
  3. Use a finger to pan the canvas with one-touch gestures and confirm panning works correctly.
  4. Ensure middle mouse button panning, spacebar panning, and eraser functionality remain unchanged in pen mode (pass existing test suite).
  5. Confirm inputs outside of pen mode behave as expected (pass existing test suite).

Added additional tests to each to ensure that when pen mode is activated, it does not affect their functionality.

  • Unit tests
  • End-to-end tests

Release notes

  • Improved pen mode behavior by enabling one-finger panning for touch gestures while preserving existing functionality for other input types.

Copy link

vercel bot commented Nov 29, 2024

@gekiclaws is attempting to deploy a commit to the tldraw Team on Vercel.

A member of the Team first needs to authorize it.

@huppy-bot
Copy link
Contributor

huppy-bot bot commented Nov 29, 2024

2 out of 2 authors have signed the CLA.

Thanks!

@gekiclaws
Copy link
Author

I have read and agree to the Contributor License Agreement.

@huppy-bot huppy-bot bot added the improvement Product improvement label Nov 29, 2024
@steveruizok
Copy link
Collaborator

Thanks for the PR @gekiclaws! I like the basic idea a lot.

One of the reasons we have pen mode at all is that palm rejection is very bad in browsers such as iPad Safari. My worry here is that allowing for touch navigation would cause accidental palm taps to move the camera, in the same way that they used to make dots! Have you had a chance to try this at all on a tablet, and did you notice any accidental movement from palms? Maybe we could use two-finger navigation instead?

@gekiclaws
Copy link
Author

gekiclaws commented Dec 1, 2024

Hi Steve,

I've had a chance to test this on my S24 Ultra using the S Pen to verify my feature edit works in my local deployment. I didn’t initially consider the issue of accidental palm taps, but I’ve now tested two cases in pen mode on my phone:

  1. Resting my palm on the screen while writing with the stylus – writing works, and the camera doesn’t move.
  2. Resting my palm and moving it around – the camera still doesn’t move.

The existing two-finger navigation is great when drawing with a finger, but when using a stylus, one-finger panning feels much more natural. Two-finger navigation is also still supported. Let me know what you think!

@gekiclaws gekiclaws closed this Dec 2, 2024
@gekiclaws gekiclaws deleted the one-finger-pan-in-pen-mode branch December 2, 2024 20:24
@gekiclaws gekiclaws restored the one-finger-pan-in-pen-mode branch December 2, 2024 23:52
@gekiclaws gekiclaws reopened this Dec 2, 2024
@rosyyang224 rosyyang224 force-pushed the one-finger-pan-in-pen-mode branch from 5d7969d to 905f948 Compare December 3, 2024 04:56
Restores middle mouse button and spacebar panning functionality
@huppy-bot huppy-bot bot added the feature New feature label Dec 3, 2024
Tests for single-finger panning in pen mode
@rosyyang224
Copy link

I have read and agree to the Contributor License Agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature improvement Product improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tldraw/tldraw/pull/5026

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy