mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Refactor Element Functions (#233)
* Remove `generatedraw` from element object - Create a function that renders a single element - Refactor rendering selected elements * Replace getElementAbsoluteXY with getElementAbsoluteCoords
This commit is contained in:
parent
85365e5bcb
commit
829a65b8cb
14 changed files with 206 additions and 184 deletions
|
@ -1,5 +1,4 @@
|
|||
import { ExcalidrawElement } from "./element/types";
|
||||
import { generateDraw } from "./element";
|
||||
|
||||
class SceneHistory {
|
||||
private recording: boolean = true;
|
||||
|
@ -27,7 +26,6 @@ class SceneHistory {
|
|||
const newElements = JSON.parse(entry);
|
||||
elements.splice(0, elements.length);
|
||||
newElements.forEach((newElement: ExcalidrawElement) => {
|
||||
generateDraw(newElement);
|
||||
elements.push(newElement);
|
||||
});
|
||||
// When restoring, we shouldn't add an history entry otherwise we'll be stuck with it and can't go back
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue