소스 검색

edit:fit>圆形和矩形在toData的时候重新计算左上和右下的坐标

zhangyu 4 년 전
부모
커밋
0745c79b71
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      persagy-web-edit/src/items/SBaseCircleEdit.ts
  2. 1 1
      persagy-web-edit/src/items/SBaseRectEdit.ts

+ 1 - 1
persagy-web-edit/src/items/SBaseCircleEdit.ts

@@ -356,6 +356,7 @@ export class SBaseCircleEdit extends SGraphEdit {
 
         this.x = 0;
         this.y = 0;
+        this.calRect();
     } // Function moveToOrigin()
 
     /**
@@ -385,7 +386,6 @@ export class SBaseCircleEdit extends SGraphEdit {
      */
     onDraw(painter: SPainter): void {
         if (this.line.length == 2) {
-            this.calRect();
             painter.pen.color = this.strokeColor;
             painter.brush.color = this.fillColor;
 

+ 1 - 1
persagy-web-edit/src/items/SBaseRectEdit.ts

@@ -357,6 +357,7 @@ export class SBaseRectEdit extends SGraphEdit {
         });
         this.x = 0;
         this.y = 0;
+        this.calRect();
     } // Function moveToOrigin()
 
     /**
@@ -385,7 +386,6 @@ export class SBaseRectEdit extends SGraphEdit {
      */
     onDraw(painter: SPainter): void {
         if (this.line.length == 2) {
-            // this.calRect();
             painter.pen.color = this.strokeColor;
             painter.brush.color = this.fillColor;