From edfcd7e9f590e4a2b3b4b5bd7405710aca643e2c Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 2 May 2024 19:40:34 +0300 Subject: [PATCH 1/2] chore(FabricObject): pass `e` to `shouldStartDragging` --- src/canvas/Canvas.ts | 2 +- src/shapes/Object/InteractiveObject.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/canvas/Canvas.ts b/src/canvas/Canvas.ts index ba0a0efbd78..311d218752a 100644 --- a/src/canvas/Canvas.ts +++ b/src/canvas/Canvas.ts @@ -732,7 +732,7 @@ export class Canvas extends SelectableCanvas implements CanvasOptions { (!activeObject || // a drag event sequence is started by the active object flagging itself on mousedown / mousedown:before // we must not prevent the event's default behavior in order for the window to start dragging - !activeObject.shouldStartDragging()) && + !activeObject.shouldStartDragging(e)) && e.preventDefault && e.preventDefault(); this.__onMouseMove(e); diff --git a/src/shapes/Object/InteractiveObject.ts b/src/shapes/Object/InteractiveObject.ts index 86f0cfceb84..1a8c1b9b9e8 100644 --- a/src/shapes/Object/InteractiveObject.ts +++ b/src/shapes/Object/InteractiveObject.ts @@ -653,7 +653,7 @@ export class InteractiveFabricObject< * Fired from {@link Canvas#_onMouseMove} * @returns true in order for the window to start a drag session */ - shouldStartDragging() { + shouldStartDragging(e: TPointerEvent) { return false; } From 4dd40da43d815262ac771ddbd111f50196608d2b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 May 2024 16:41:37 +0000 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1304d81e372..dd512739ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- chore(FabricObject): pass `e` to `shouldStartDragging` [#9843](https://github.com/fabricjs/fabric.js/pull/9843) - ci(): Add Jest coverage to the report [#9836](https://github.com/fabricjs/fabric.js/pull/9836) - test(): Add cursor animation testing and migrate some easy one to jest [#9829](https://github.com/fabricjs/fabric.js/pull/9829) - fix(Group, Controls): Fix interactive group actions when negative scaling is involved [#9811](https://github.com/fabricjs/fabric.js/pull/9811)