f2346275ef
* Extract Side Panel from App component * Refactor SidePanel component - Remove unnecessary props (we are already passing appState as a prop) - Remove unnecessary allback (we are already passing setState)
10 lines
334 B
TypeScript
10 lines
334 B
TypeScript
import { measureText } from "../utils";
|
|
import { ExcalidrawTextElement } from "./types";
|
|
|
|
export const redrawTextBoundingBox = (element: ExcalidrawTextElement) => {
|
|
const metrics = measureText(element.text, element.font);
|
|
element.width = metrics.width;
|
|
element.height = metrics.height;
|
|
element.baseline = metrics.baseline;
|
|
};
|