fix: Corner jumping & hints (#10403)
* fix: Corner jumping Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: Hints Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: No corner avoidance for simple arrows Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * show alt/cmd hint when creating/moving arrow point any time --------- Signed-off-by: Mark Tolmacs <mark@lazycat.hu> Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -62,6 +62,20 @@ const getHints = ({
|
||||
shortcut: getTaggedShortcutKey("Alt"),
|
||||
});
|
||||
}
|
||||
|
||||
const selectedElements = app.scene.getSelectedElements(appState);
|
||||
|
||||
// creating or dragging arrow point
|
||||
if (
|
||||
appState.selectedLinearElement?.isDragging &&
|
||||
selectedElements[0]?.type === "arrow"
|
||||
) {
|
||||
return t("hints.arrowBindModifiers", {
|
||||
shortcut_1: getTaggedShortcutKey("Ctrl"),
|
||||
shortcut_2: getTaggedShortcutKey("Alt"),
|
||||
});
|
||||
}
|
||||
|
||||
if (activeTool.type === "arrow" || activeTool.type === "line") {
|
||||
if (multiMode) {
|
||||
return t("hints.linearElementMulti", {
|
||||
@@ -89,8 +103,6 @@ const getHints = ({
|
||||
return t("hints.embeddable");
|
||||
}
|
||||
|
||||
const selectedElements = app.scene.getSelectedElements(appState);
|
||||
|
||||
if (
|
||||
isResizing &&
|
||||
lastPointerDownWith === "mouse" &&
|
||||
|
||||
@@ -646,14 +646,8 @@ const LayerUI = ({
|
||||
};
|
||||
|
||||
const stripIrrelevantAppStateProps = (appState: AppState): UIAppState => {
|
||||
const {
|
||||
suggestedBinding,
|
||||
startBoundElement,
|
||||
cursorButton,
|
||||
scrollX,
|
||||
scrollY,
|
||||
...ret
|
||||
} = appState;
|
||||
const { startBoundElement, cursorButton, scrollX, scrollY, ...ret } =
|
||||
appState;
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user