mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
confirm arrow on doubleclick (#949)
* confirm arrow on double click * change hint * fix cursor not updating on click
This commit is contained in:
parent
254a0753ff
commit
b7da524538
7 changed files with 95 additions and 16 deletions
|
@ -18,12 +18,15 @@ export const actionFinalize = register({
|
|||
if (appState.multiElement) {
|
||||
// pen and mouse have hover
|
||||
if (appState.lastPointerDownWith !== "touch") {
|
||||
mutateElement(appState.multiElement, {
|
||||
points: appState.multiElement.points.slice(
|
||||
0,
|
||||
appState.multiElement.points.length - 1,
|
||||
),
|
||||
});
|
||||
const { points, lastCommittedPoint } = appState.multiElement;
|
||||
if (
|
||||
!lastCommittedPoint ||
|
||||
points[points.length - 1] !== lastCommittedPoint
|
||||
) {
|
||||
mutateElement(appState.multiElement, {
|
||||
points: appState.multiElement.points.slice(0, -1),
|
||||
});
|
||||
}
|
||||
}
|
||||
if (isInvisiblySmallElement(appState.multiElement)) {
|
||||
newElements = newElements.slice(0, -1);
|
||||
|
|
|
@ -60,6 +60,16 @@ export class ActionManager implements ActionsManagerInterface {
|
|||
return true;
|
||||
}
|
||||
|
||||
executeAction(action: Action) {
|
||||
const commitToHistory =
|
||||
action.commitToHistory &&
|
||||
action.commitToHistory(this.getAppState(), this.getElements());
|
||||
this.updater(
|
||||
action.perform(this.getElements(), this.getAppState(), null),
|
||||
commitToHistory,
|
||||
);
|
||||
}
|
||||
|
||||
getContextMenuItems(actionFilter: ActionFilterFn = action => action) {
|
||||
return Object.values(this.actions)
|
||||
.filter(actionFilter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue