fix(editor): move cursor not displaying for common bbox
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
|||||||
KEYS,
|
KEYS,
|
||||||
APP_NAME,
|
APP_NAME,
|
||||||
CURSOR_TYPE,
|
CURSOR_TYPE,
|
||||||
|
DEFAULT_TRANSFORM_HANDLE_SPACING,
|
||||||
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
||||||
DEFAULT_VERTICAL_ALIGN,
|
DEFAULT_VERTICAL_ALIGN,
|
||||||
DRAGGING_THRESHOLD,
|
DRAGGING_THRESHOLD,
|
||||||
@@ -7239,6 +7240,14 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.interactiveCanvas,
|
this.interactiveCanvas,
|
||||||
isTextElement(hitElement) ? CURSOR_TYPE.TEXT : CURSOR_TYPE.CROSSHAIR,
|
isTextElement(hitElement) ? CURSOR_TYPE.TEXT : CURSOR_TYPE.CROSSHAIR,
|
||||||
);
|
);
|
||||||
|
} else if (
|
||||||
|
!event[KEYS.CTRL_OR_CMD] &&
|
||||||
|
this.isHittingCommonBoundingBoxOfSelectedElements(
|
||||||
|
scenePointer,
|
||||||
|
selectedElements,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
setCursor(this.interactiveCanvas, CURSOR_TYPE.MOVE);
|
||||||
} else if (this.state.viewModeEnabled) {
|
} else if (this.state.viewModeEnabled) {
|
||||||
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRAB);
|
setCursor(this.interactiveCanvas, CURSOR_TYPE.GRAB);
|
||||||
} else if (this.state.openDialog?.name === "elementLinkSelector") {
|
} else if (this.state.openDialog?.name === "elementLinkSelector") {
|
||||||
@@ -8729,12 +8738,14 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
DEFAULT_COLLISION_THRESHOLD / this.state.zoom.value,
|
DEFAULT_COLLISION_THRESHOLD / this.state.zoom.value,
|
||||||
1,
|
1,
|
||||||
);
|
);
|
||||||
|
const boundsPadding =
|
||||||
|
(DEFAULT_TRANSFORM_HANDLE_SPACING * 2) / this.state.zoom.value;
|
||||||
const [x1, y1, x2, y2] = getCommonBounds(selectedElements);
|
const [x1, y1, x2, y2] = getCommonBounds(selectedElements);
|
||||||
return (
|
return (
|
||||||
point.x > x1 - threshold &&
|
point.x > x1 - boundsPadding - threshold &&
|
||||||
point.x < x2 + threshold &&
|
point.x < x2 + boundsPadding + threshold &&
|
||||||
point.y > y1 - threshold &&
|
point.y > y1 - boundsPadding - threshold &&
|
||||||
point.y < y2 + threshold
|
point.y < y2 + boundsPadding + threshold
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user