mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-10-18 05:29:54 +02:00
fix element width
This commit is contained in:
@@ -379,7 +379,12 @@ export const textWysiwyg = ({
|
||||
font,
|
||||
getMaxContainerWidth(container),
|
||||
);
|
||||
const width = getTextWidth(wrappedText, font);
|
||||
const { width } = measureText(
|
||||
wrappedText,
|
||||
font,
|
||||
element.lineHeight,
|
||||
getMaxContainerWidth(container),
|
||||
);
|
||||
editable.style.width = `${width}px`;
|
||||
}
|
||||
};
|
||||
@@ -400,6 +405,7 @@ export const textWysiwyg = ({
|
||||
wrappedText,
|
||||
font,
|
||||
updatedTextElement.lineHeight,
|
||||
getMaxContainerWidth(container!),
|
||||
);
|
||||
editable.style.width = `${width}px`;
|
||||
editable.style.height = `${height}px`;
|
||||
|
Reference in New Issue
Block a user