fractionalIndex as a byproduct or zIndex

This commit is contained in:
Ryan Di
2023-11-29 17:35:59 +08:00
parent c7ee46e7f8
commit 02dc00a47e
7 changed files with 128 additions and 24 deletions
+1
View File
@@ -17,6 +17,7 @@ const elementBase: Omit<ExcalidrawElement, "type"> = {
groupIds: [],
frameId: null,
roundness: null,
fractionalIndex: Infinity,
seed: 1041657908,
version: 120,
versionNonce: 1188004276,
+2
View File
@@ -100,6 +100,7 @@ export class API {
id?: string;
isDeleted?: boolean;
frameId?: ExcalidrawElement["id"] | null;
fractionalIndex: ExcalidrawElement["fractionalIndex"];
groupIds?: string[];
// generic element props
strokeColor?: ExcalidrawGenericElement["strokeColor"];
@@ -167,6 +168,7 @@ export class API {
x,
y,
frameId: rest.frameId ?? null,
fractionalIndex: rest.fractionalIndex ?? Infinity,
angle: rest.angle ?? 0,
strokeColor: rest.strokeColor ?? appState.currentItemStrokeColor,
backgroundColor: