mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-21 16:29:58 +02:00
fix: set height correctly when text properties updated while editing in container until first submit (#4469)
* fix: set height correctly when text properties updated while editing in container * rename PADDING to BOUND_TEXT_PADDING
This commit is contained in:
@@ -12,6 +12,9 @@ import {
|
||||
DEFAULT_FONT_FAMILY,
|
||||
DEFAULT_TEXT_ALIGN,
|
||||
} from "../constants";
|
||||
import Scene from "../scene/Scene";
|
||||
import { isBoundToContainer } from "../element/typeChecks";
|
||||
import { ExcalidrawTextElement } from "../element/types";
|
||||
|
||||
// `copiedStyles` is exported only for tests.
|
||||
export let copiedStyles: string = "{}";
|
||||
@@ -61,7 +64,14 @@ export const actionPasteStyles = register({
|
||||
fontFamily: pastedElement?.fontFamily || DEFAULT_FONT_FAMILY,
|
||||
textAlign: pastedElement?.textAlign || DEFAULT_TEXT_ALIGN,
|
||||
});
|
||||
redrawTextBoundingBox(newElement);
|
||||
let container = null;
|
||||
|
||||
if (isBoundToContainer(element)) {
|
||||
container = Scene.getScene(element)!.getElement(
|
||||
element.containerId,
|
||||
);
|
||||
}
|
||||
redrawTextBoundingBox(element as ExcalidrawTextElement, container);
|
||||
}
|
||||
return newElement;
|
||||
}
|
||||
|
Reference in New Issue
Block a user