Ensure arrows are not draggable from inside (#1620)
This commit is contained in:
parent
c427aa3cce
commit
584e4182a7
@ -23,6 +23,9 @@ const isElementDraggableFromInside = (
|
|||||||
element: NonDeletedExcalidrawElement,
|
element: NonDeletedExcalidrawElement,
|
||||||
appState: AppState,
|
appState: AppState,
|
||||||
): boolean => {
|
): boolean => {
|
||||||
|
if (element.type === "arrow") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const dragFromInside =
|
const dragFromInside =
|
||||||
element.backgroundColor !== "transparent" ||
|
element.backgroundColor !== "transparent" ||
|
||||||
appState.selectedElementIds[element.id];
|
appState.selectedElementIds[element.id];
|
||||||
|
@ -192,22 +192,20 @@ export const generateRoughOptions = (element: ExcalidrawElement): Options => {
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
case "line":
|
case "line":
|
||||||
case "draw":
|
case "draw": {
|
||||||
case "arrow": {
|
|
||||||
// If shape is a line and is a closed shape,
|
// If shape is a line and is a closed shape,
|
||||||
// fill the shape if a color is set.
|
// fill the shape if a color is set.
|
||||||
if (element.type === "line" || element.type === "draw") {
|
if (isPathALoop(element.points)) {
|
||||||
if (isPathALoop(element.points)) {
|
options.fillStyle = element.fillStyle;
|
||||||
options.fillStyle = element.fillStyle;
|
options.fill =
|
||||||
options.fill =
|
element.backgroundColor === "transparent"
|
||||||
element.backgroundColor === "transparent"
|
? undefined
|
||||||
? undefined
|
: element.backgroundColor;
|
||||||
: element.backgroundColor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
case "arrow":
|
||||||
|
return options;
|
||||||
default: {
|
default: {
|
||||||
throw new Error(`Unimplemented type ${element.type}`);
|
throw new Error(`Unimplemented type ${element.type}`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user