mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Abstract away or eliminate most of the mutation of the Elements array (#955)
This commit is contained in:
parent
05af9f04ed
commit
e1e2249f57
17 changed files with 293 additions and 272 deletions
|
@ -1,6 +1,6 @@
|
|||
import { randomSeed } from "roughjs/bin/math";
|
||||
import nanoid from "nanoid";
|
||||
import { Point } from "roughjs/bin/geometry";
|
||||
import { Point } from "../types";
|
||||
|
||||
import { ExcalidrawElement, ExcalidrawTextElement } from "../element/types";
|
||||
import { measureText } from "../utils";
|
||||
|
@ -32,7 +32,7 @@ export function newElement(
|
|||
roughness,
|
||||
opacity,
|
||||
seed: randomSeed(),
|
||||
points: [] as Point[],
|
||||
points: [] as readonly Point[],
|
||||
version: 1,
|
||||
versionNonce: 0,
|
||||
isDeleted: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue