mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 07:20:21 +02:00
apply offset only if in container
This commit is contained in:
@@ -270,13 +270,15 @@ export const textWysiwyg = ({
|
||||
const lineHeight = updatedTextElement.containerId
|
||||
? approxLineHeight
|
||||
: updatedTextElement.height / lines.length;
|
||||
let magicOffset = 0;
|
||||
if (!container) {
|
||||
maxWidth = (appState.width - 8 - viewportX) / appState.zoom.value;
|
||||
textElementWidth = Math.min(textElementWidth, maxWidth);
|
||||
} else {
|
||||
magicOffset = excalidrawContainer
|
||||
? parseFloat(getComputedStyle(excalidrawContainer).fontSize)
|
||||
: 16;
|
||||
}
|
||||
const magicOffset = excalidrawContainer
|
||||
? parseFloat(getComputedStyle(excalidrawContainer).fontSize)
|
||||
: 16;
|
||||
// Make sure text editor height doesn't go beyond viewport
|
||||
const editorMaxHeight =
|
||||
(appState.height - viewportY) / appState.zoom.value;
|
||||
|
Reference in New Issue
Block a user