瀏覽代碼

Reflect `textAlign` when pasting a style (#1378)

* Reflect `textAlign` when pasting a style

* Re-run Actions
fujimoto kyosuke 5 年之前
父節點
當前提交
38c7d5a7bf
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/actions/actionStyles.ts

+ 2 - 1
src/actions/actionStyles.ts

@@ -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);
           }