ad1992 3 年之前
父节点
当前提交
52a129c4dd
共有 2 个文件被更改,包括 11 次插入11 次删除
  1. 10 10
      src/actions/actionProperties.tsx
  2. 1 1
      src/element/textElement.ts

+ 10 - 10
src/actions/actionProperties.tsx

@@ -42,7 +42,7 @@ import {
   redrawTextBoundingBox,
 } from "../element";
 import { newElementWith } from "../element/mutateElement";
-import { getBoundedTextElement } from "../element/textElement";
+import { getBoundTextElement } from "../element/textElement";
 import { isLinearElement, isLinearElementType } from "../element/typeChecks";
 import {
   Arrowhead,
@@ -495,9 +495,9 @@ export const actionChangeFontSize = register({
             if (isTextElement(element)) {
               return element.fontSize;
             }
-            const boundedTextElement = getBoundedTextElement(element);
-            if (boundedTextElement) {
-              return boundedTextElement.fontSize;
+            const boundTextElement = getBoundTextElement(element);
+            if (boundTextElement) {
+              return boundTextElement.fontSize;
             }
             return null;
           },
@@ -576,9 +576,9 @@ export const actionChangeFontFamily = register({
               if (isTextElement(element)) {
                 return element.fontFamily;
               }
-              const boundedTextElement = getBoundedTextElement(element);
-              if (boundedTextElement) {
-                return boundedTextElement.fontFamily;
+              const boundTextElement = getBoundTextElement(element);
+              if (boundTextElement) {
+                return boundTextElement.fontFamily;
               }
               return null;
             },
@@ -651,9 +651,9 @@ export const actionChangeTextAlign = register({
             if (isTextElement(element)) {
               return element.textAlign;
             }
-            const boundedTextElement = getBoundedTextElement(element);
-            if (boundedTextElement) {
-              return boundedTextElement.textAlign;
+            const boundTextElement = getBoundTextElement(element);
+            if (boundTextElement) {
+              return boundTextElement.textAlign;
             }
             return null;
           },

+ 1 - 1
src/element/textElement.ts

@@ -410,7 +410,7 @@ export const getBoundTextElementId = (container: ExcalidrawElement | null) => {
   return container?.boundElements?.filter((ele) => ele.type === "text")[0]?.id;
 };
 
-export const getBoundedTextElement = (element: ExcalidrawElement | null) => {
+export const getBoundTextElement = (element: ExcalidrawElement | null) => {
   if (!element) {
     return null;
   }