1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2025-02-18 13:29:36 +01:00

Reflect textAlign when pasting a style (#1378)

* Reflect `textAlign` when pasting a style

* Re-run Actions
This commit is contained in:
fujimoto kyosuke 2020-04-18 23:43:21 +09:00 committed by GitHub
parent 2bfb0c20c3
commit 38c7d5a7bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,7 +4,7 @@ import {
redrawTextBoundingBox,
} from "../element";
import { KEYS } from "../keys";
import { DEFAULT_FONT } from "../appState";
import { DEFAULT_FONT, DEFAULT_TEXT_ALIGN } from "../appState";
import { register } from "./register";
import { mutateElement, newElementWith } from "../element/mutateElement";
@ -48,6 +48,7 @@ export const actionPasteStyles = register({
if (isTextElement(newElement)) {
mutateElement(newElement, {
font: pastedElement?.font || DEFAULT_FONT,
textAlign: pastedElement?.textAlign || DEFAULT_TEXT_ALIGN,
});
redrawTextBoundingBox(newElement);
}