refactor: decoupling global Scene state part-1 (#7577)

This commit is contained in:
David Luzar
2024-01-22 00:23:02 +01:00
committed by GitHub
parent 740a165452
commit 0415c616b1
31 changed files with 630 additions and 384 deletions
+8 -1
View File
@@ -1,5 +1,6 @@
import { isTextElement, refreshTextDimensions } from "../element";
import { newElementWith } from "../element/mutateElement";
import { getContainerElement } from "../element/textElement";
import { isBoundToContainer } from "../element/typeChecks";
import { ExcalidrawElement, ExcalidrawTextElement } from "../element/types";
import { getFontString } from "../utils";
@@ -57,7 +58,13 @@ export class Fonts {
ShapeCache.delete(element);
didUpdate = true;
return newElementWith(element, {
...refreshTextDimensions(element),
...refreshTextDimensions(
element,
getContainerElement(
element,
this.scene.getElementsMapIncludingDeleted(),
),
),
});
}
return element;