Fix horizontal wheel panning on the canvas - #1113
Open
yzxcj797 wants to merge 1 commit into
Open
Conversation
Resolve wheel pan deltas through a helper that accepts both browser reporting conventions for Shift + wheel: Chromium on macOS translates the vertical input to deltaX while other platforms keep deltaY. Also apply plain deltaX so native horizontal wheels and trackpads pan the canvas instead of being ignored. Fixes drawdb-io#1108
|
@yzxcj797 is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deltaXanddeltaY.deltaY, while also supporting Chromium/macOS browsers that translate the same gesture todeltaX.Fixes #1108.
Root cause
The previous panning branch only read
deltaY. Browsers do not report Shift+wheel uniformly: some preserve the vertical value indeltaY, while Chromium on macOS can translate it todeltaXwithdeltaY === 0. Native horizontal wheels also produce a non-zerodeltaX. In those cases the old calculation added zero and the canvas appeared not to move.Testing
npm test— 6/6 tests passnpm run lint— passes with zero warningsnpm run build— passes (existing lottie-web eval and large-chunk warnings remain)git diff --check— passesI also exercised the canvas wheel path in Chromium with both Shift+wheel reporting forms, native horizontal wheel input, vertical wheel input, and Ctrl+wheel zoom; panning and zoom behavior remained correct.