-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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(): regression of getPointer
usages + BREAKING: drop event data
#9186
Conversation
commit 71d898d Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 15:33:14 2023 +0530 fix jest.extend commit c5c5d38 Merge: 19fab4e a445362 Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 13:57:47 2023 +0530 Merge branch 'master' into rm-vpt-methods commit 19fab4e Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 13:49:14 2023 +0530 dep commit be1dfd0 Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 13:48:19 2023 +0530 fix round snapshots Update jest.extend.ts commit 1dfcefc Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Aug 26 08:40:58 2023 +0530 Update eventData.test.ts commit 0b47e20 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 20:50:09 2023 +0530 fix mouseup test leanup Update eventData.test.ts commit ab38a5d Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 19:12:19 2023 +0530 tests commit e567b27 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 17:19:01 2023 +0530 cleanup commit d201b34 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:21:31 2023 +0530 comment Update SelectableCanvas.ts Update SelectableCanvas.ts commit 3731da4 Merge: 2636773 7de49ff Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:14:58 2023 +0530 Merge branch 'rm-vpt-methods' of https://github.com/fabricjs/fabric.js into rm-vpt-methods commit 2636773 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:12:17 2023 +0530 revert commit 7de49ff Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Fri Aug 25 09:35:04 2023 +0000 update CHANGELOG.md commit 7824e2f Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:03:24 2023 +0530 fix dramatic bug not a single test to account for commit 017beb3 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 14:30:56 2023 +0530 very weird comment commit 23d3ec4 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Fri Aug 25 08:44:37 2023 +0000 update CHANGELOG.md commit ccf1e5a Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 14:10:56 2023 +0530 patch(Canvas): rm `_normalizePointer`, `restorePointerVpt` Update dom_misc.ts
3de8c04
to
ab07ee8
Compare
Build Stats
|
commit 71d898d Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 15:33:14 2023 +0530 fix jest.extend commit c5c5d38 Merge: 19fab4e a445362 Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 13:57:47 2023 +0530 Merge branch 'master' into rm-vpt-methods commit 19fab4e Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 13:49:14 2023 +0530 dep commit be1dfd0 Author: ShaMan123 <shacharnen@gmail.com> Date: Tue Aug 29 13:48:19 2023 +0530 fix round snapshots Update jest.extend.ts commit 1dfcefc Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Aug 26 08:40:58 2023 +0530 Update eventData.test.ts commit 0b47e20 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 20:50:09 2023 +0530 fix mouseup test leanup Update eventData.test.ts commit ab38a5d Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 19:12:19 2023 +0530 tests commit e567b27 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 17:19:01 2023 +0530 cleanup commit d201b34 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:21:31 2023 +0530 comment Update SelectableCanvas.ts Update SelectableCanvas.ts commit 3731da4 Merge: 2636773 7de49ff Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:14:58 2023 +0530 Merge branch 'rm-vpt-methods' of https://github.com/fabricjs/fabric.js into rm-vpt-methods commit 2636773 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:12:17 2023 +0530 revert commit 7de49ff Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Fri Aug 25 09:35:04 2023 +0000 update CHANGELOG.md commit 7824e2f Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 15:03:24 2023 +0530 fix dramatic bug not a single test to account for commit 017beb3 Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 14:30:56 2023 +0530 very weird comment commit 23d3ec4 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Fri Aug 25 08:44:37 2023 +0000 update CHANGELOG.md commit ccf1e5a Author: ShaMan123 <shacharnen@gmail.com> Date: Fri Aug 25 14:10:56 2023 +0530 patch(Canvas): rm `_normalizePointer`, `restorePointerVpt` Update dom_misc.ts Update canvas.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
step
…abric.js into fix-getPointer-usages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready for reviewing and fixing
@ShaMan123 those are the only swap instances i could find. Do you think there are more? I removed the identity matrix test and i added a more generic matrix that doesn't put the absolute pointer in 0,0 |
src/canvas/Canvas.ts
Outdated
@@ -512,6 +512,8 @@ export class Canvas extends SelectableCanvas implements CanvasOptions { | |||
target, | |||
subTargets: targets, | |||
dragSource: this._dragSource, | |||
// this is an absolute pointer, the name convention is wrong. | |||
// such was in 5.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we want to do with this? do we make consistency and we fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: i normalized it. Do not merge if you don't agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
I think we should expose a protected method that build the event data so everything calls it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let with my proposal of normalization. If this is good for you is approved you can merge.
getPointer
usagesgetPointer
usages + BREAKING: drop event data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brush API also uses the wrong naming... but that was like that before v6 => to be done in #8476 IMO
Group selector also uses the absolute pointer, which is weird cause it is not affected by vpt
getPointer usages seem correct
src/canvas/Canvas.ts
Outdated
@@ -513,8 +513,8 @@ export class Canvas extends SelectableCanvas implements CanvasOptions { | |||
subTargets: targets, | |||
dragSource: this._dragSource, | |||
// this is an absolute pointer, the name convention is wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// this is an absolute pointer, the name convention is wrong. |
you anyways need to approve it since I created it, so merge at will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done?
I can't find any getPointer usage in the brush files, can you point to me? |
ok i found them and added comments. |
At least the pointers in brush are exposed to the brush functionality only, that is an issue for who is creating custom brushes that should be way less than who is just listening to events |
Motivation
prepare for #9175
fixes bug from b6f076c
Description
Somewehre in v6
_pointer
and_abolutePointer
were changed togetPointer
and manydone WRONGwere swapped in values.Not a single test catch it so I have added tests
pointer
=>getPointer(e, true)
absolutePointer
=>getPointer(e)
Changes
Gist
In Action