Przeglądaj źródła

'多边形顶点大于3时允许删除顶点'

zhangyu 5 lat temu
rodzic
commit
833e0d48ed

+ 2 - 2
saga-web-big/src/items/SIconTextItem.ts

@@ -79,7 +79,7 @@ export class SIconTextItem extends SObjectItem {
       return this.img.width;
     }
     set sWidth(v: number) {
-      this.img.width = v
+      this.img.width = v;
       this.update();
     }
 
@@ -88,7 +88,7 @@ export class SIconTextItem extends SObjectItem {
       return this.img.height;
     }
     set sHeight(v: number) {
-      this.img.height = v
+      this.img.height = v;
       this.update();
     }
 

+ 4 - 1
saga-web-big/src/items/SPolygonItem.ts

@@ -526,7 +526,10 @@ export class SPolygonItem extends SGraphItem {
             if (event.key == "Alt") {
                 this.isAlt = false;
             } else if (event.keyCode == SKeyCode.Delete) {
-                this.deletePoint(this.curIndex);
+                // 当多边形的顶点大于三个允许删除点
+                if (this.pointList.length > 3) {
+                    this.deletePoint(this.curIndex);
+                }
             }
         }
         this.update();