Revert "floor line height and height when dom height increases than canvas height"
This reverts commit 8de65168238b8fb9a638e0c75f596f371983c2c7.
This commit is contained in:
parent
8de6516823
commit
038714e715
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user