Added more checks to stage interaction
This commit is contained in:
parent
a4c67ce81f
commit
f8a2a1ece5
@ -26,10 +26,8 @@ function useStageInteraction(
|
||||
...gesture,
|
||||
onWheelStart: (props) => {
|
||||
const { event } = props;
|
||||
if (layer) {
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
}
|
||||
isInteractingWithCanvas.current =
|
||||
layer && event.target === layer.getCanvas()._canvas;
|
||||
gesture.onWheelStart && gesture.onWheelStart(props);
|
||||
},
|
||||
onWheel: (props) => {
|
||||
@ -63,10 +61,8 @@ function useStageInteraction(
|
||||
},
|
||||
onPinchStart: (props) => {
|
||||
const { event } = props;
|
||||
if (layer) {
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
}
|
||||
isInteractingWithCanvas.current =
|
||||
layer && event.target === layer.getCanvas()._canvas;
|
||||
const { da, origin } = props;
|
||||
const [distance] = da;
|
||||
const [originX, originY] = origin;
|
||||
@ -127,10 +123,8 @@ function useStageInteraction(
|
||||
},
|
||||
onDragStart: (props) => {
|
||||
const { event } = props;
|
||||
if (layer) {
|
||||
isInteractingWithCanvas.current =
|
||||
event.target === layer.getCanvas()._canvas;
|
||||
}
|
||||
isInteractingWithCanvas.current =
|
||||
layer && event.target === layer.getCanvas()._canvas;
|
||||
gesture.onDragStart && gesture.onDragStart(props);
|
||||
},
|
||||
onDrag: (props) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user