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:
Márk Tolmács
2025-11-26 12:00:33 +01:00
committed by GitHub
parent c141960ada
commit 019ce4c52c
6 changed files with 34 additions and 29 deletions
+14 -2
View File
@@ -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" &&
+2 -8
View File
@@ -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;
};