mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-07 09:36:58 +02:00
12 lines
353 B
TypeScript
12 lines
353 B
TypeScript
import { measureText } from "../utils";
|
|
import { MutableExcalidrawTextElement } from "./types";
|
|
|
|
export const redrawTextBoundingBox = (
|
|
element: MutableExcalidrawTextElement,
|
|
) => {
|
|
const metrics = measureText(element.text, element.font);
|
|
element.width = metrics.width;
|
|
element.height = metrics.height;
|
|
element.baseline = metrics.baseline;
|
|
};
|