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,
|
||||
appState: AppState,
|
||||
): boolean => {
|
||||
if (element.type === "arrow") {
|
||||
return false;
|
||||
}
|
||||
const dragFromInside =
|
||||
element.backgroundColor !== "transparent" ||
|
||||
appState.selectedElementIds[element.id];
|
||||
|
@ -192,11 +192,9 @@ export const generateRoughOptions = (element: ExcalidrawElement): Options => {
|
||||
return options;
|
||||
}
|
||||
case "line":
|
||||
case "draw":
|
||||
case "arrow": {
|
||||
case "draw": {
|
||||
// If shape is a line and is a closed shape,
|
||||
// fill the shape if a color is set.
|
||||
if (element.type === "line" || element.type === "draw") {
|
||||
if (isPathALoop(element.points)) {
|
||||
options.fillStyle = element.fillStyle;
|
||||
options.fill =
|
||||
@ -204,10 +202,10 @@ export const generateRoughOptions = (element: ExcalidrawElement): Options => {
|
||||
? undefined
|
||||
: element.backgroundColor;
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
case "arrow":
|
||||
return options;
|
||||
default: {
|
||||
throw new Error(`Unimplemented type ${element.type}`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user