소스 검색

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

zhangyu 5 년 전
부모
커밋
833e0d48ed
2개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      saga-web-big/src/items/SIconTextItem.ts
  2. 4 1
      saga-web-big/src/items/SPolygonItem.ts

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