Sfoglia il codice sorgente

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

zhangyu 4 anni fa
parent
commit
0745c79b71

+ 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;