mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-15 21:40:06 +02:00
Revert "floor line height and height when dom height increases than canvas height"
This reverts commit 8de6516823
.
This commit is contained in:
@@ -36,7 +36,6 @@ import {
|
|||||||
getMaxContainerWidth,
|
getMaxContainerWidth,
|
||||||
computeContainerDimensionForBoundText,
|
computeContainerDimensionForBoundText,
|
||||||
measureDOMHeight,
|
measureDOMHeight,
|
||||||
getLineHeightInPx,
|
|
||||||
splitIntoLines,
|
splitIntoLines,
|
||||||
} from "./textElement";
|
} from "./textElement";
|
||||||
import {
|
import {
|
||||||
@@ -279,19 +278,11 @@ export const textWysiwyg = ({
|
|||||||
getFontString(updatedTextElement),
|
getFontString(updatedTextElement),
|
||||||
updatedTextElement.lineHeight,
|
updatedTextElement.lineHeight,
|
||||||
);
|
);
|
||||||
|
|
||||||
let lineHeight = element.lineHeight;
|
let lineHeight = element.lineHeight;
|
||||||
if (isSafari) {
|
if (isSafari && domHeight > textElementHeight) {
|
||||||
const lineCount = splitIntoLines(element.text).length;
|
lineHeight = (Math.floor(element.lineHeight * element.fontSize) /
|
||||||
if (domHeight > textElementHeight) {
|
element.fontSize) as ExcalidrawTextElement["lineHeight"];
|
||||||
lineHeight = (Math.floor(element.lineHeight * element.fontSize) /
|
|
||||||
element.fontSize) as ExcalidrawTextElement["lineHeight"];
|
|
||||||
textElementHeight =
|
|
||||||
getLineHeightInPx(element.fontSize, lineHeight) * lineCount;
|
|
||||||
mutateElement(updatedTextElement, {
|
|
||||||
lineHeight,
|
|
||||||
height: textElementHeight,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure text editor height doesn't go beyond viewport
|
// Make sure text editor height doesn't go beyond viewport
|
||||||
|
Reference in New Issue
Block a user