fix: Elbow arrow z-index binding (#9067)

This commit is contained in:
Márk Tolmács 2025-02-01 19:21:03 +01:00 committed by GitHub
parent 86c67bd37f
commit 302664e500
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 165 additions and 31 deletions

View file

@ -33,13 +33,16 @@ export const mutateElement = <TElement extends Mutable<ExcalidrawElement>>(
// casting to any because can't use `in` operator
// (see https://github.com/microsoft/TypeScript/issues/21732)
const { points, fixedSegments, fileId } = updates as any;
const { points, fixedSegments, fileId, startBinding, endBinding } =
updates as any;
if (
isElbowArrow(element) &&
(Object.keys(updates).length === 0 || // normalization case
typeof points !== "undefined" || // repositioning
typeof fixedSegments !== "undefined") // segment fixing
typeof fixedSegments !== "undefined" || // segment fixing
typeof startBinding !== "undefined" ||
typeof endBinding !== "undefined") // manual binding to element
) {
const elementsMap = toBrandedType<SceneElementsMap>(
Scene.getScene(element)?.getNonDeletedElementsMap() ?? new Map(),
@ -58,6 +61,8 @@ export const mutateElement = <TElement extends Mutable<ExcalidrawElement>>(
{
fixedSegments,
points,
startBinding,
endBinding,
},
{
isDragging: options?.isDragging,