Abstract away or eliminate most of the mutation of the Elements array (#955)
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import { measureText } from "../utils";
|
||||
import { ExcalidrawTextElement } from "./types";
|
||||
import { mutateTextElement } from "./mutateElement";
|
||||
import { mutateElement } from "./mutateElement";
|
||||
|
||||
export const redrawTextBoundingBox = (element: ExcalidrawTextElement) => {
|
||||
const metrics = measureText(element.text, element.font);
|
||||
mutateTextElement(element, {
|
||||
mutateElement(element, {
|
||||
width: metrics.width,
|
||||
height: metrics.height,
|
||||
baseline: metrics.baseline,
|
||||
|
Reference in New Issue
Block a user