소스 검색

fix:字体回撤问题

jinx 2 년 전
부모
커밋
42eb40aeda
3개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      server/test/a0k4xu045_202305311600080410/attach/sceneStore
  2. 0 1
      src/graphic/History/Change.js
  3. 9 1
      src/graphic/History/HistoryUtil.js

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 0 - 1
src/graphic/History/Change.js

@@ -272,7 +272,6 @@ export default class Change {
     for (const key in texts) {
       const text = texts[key];
       const lastText = this.lastData.texts[key];
-
       // 不存在意味着增加
       if (!lastText) {
         const item = {

+ 9 - 1
src/graphic/History/HistoryUtil.js

@@ -78,7 +78,9 @@ export default class HistoryUtil {
     if (
       mathUtil.equalPoint(text1.center, text2.center) &&
       text1.value == text2.value &&
-      text1.angle == text2.angle
+      text1.angle == text2.angle && 
+      text1.fontSize == text2.fontSize && 
+      text1.color == text2.color 
     ) {
       return false;
     } else {
@@ -387,6 +389,8 @@ export default class HistoryUtil {
     textInfo.value = text2.value;
     textInfo.center = JSON.parse(JSON.stringify(text2.center));
     textInfo.angle = text2.angle;
+    textInfo.color = text2.color;
+    textInfo.fontSize = text2.fontSize;
     this.setTextInfo(textInfo);
   }
 
@@ -633,6 +637,8 @@ export default class HistoryUtil {
     data.center = {};
     mathUtil.clonePoint(data.center, text.center);
     data.value = text.value;
+    data.fontSize = text.fontSize 
+    data.color = text.color 
     return data;
   }
 
@@ -856,6 +862,8 @@ export default class HistoryUtil {
     text.center = JSON.parse(JSON.stringify(textInfo.center));
     text.value = textInfo.value;
     text.angle = textInfo.angle;
+    text.fontSize = textInfo.fontSize;
+    text.color = textInfo.color;
   }
 
   setMagnifierInfo(magnifierInfo) {