|
@@ -1,5 +1,5 @@
|
|
|
import { SColor, SLine, SPainter, SPoint, SRect } from "@saga-web/draw";
|
|
|
-import { SMouseEvent, SUndoStack } from "@saga-web/base";
|
|
|
+import { SMouseEvent, SUndoStack, SKeyCode } from "@saga-web/base";
|
|
|
import { SItemStatus } from "..";
|
|
|
import { SMathUtil } from "../utils/SMathUtil";
|
|
|
import {
|
|
@@ -166,7 +166,7 @@ export class SPolylineItem extends SGraphItem {
|
|
|
* @return boolean 是否处理事件
|
|
|
* */
|
|
|
onMouseDown(event: SMouseEvent): boolean {
|
|
|
- this.curIndex = -1;
|
|
|
+ // this.curIndex = -1;
|
|
|
this.curPoint = null;
|
|
|
if (event.buttons == 1) {
|
|
|
if (this.status == SItemStatus.Create) {
|
|
@@ -241,8 +241,8 @@ export class SPolylineItem extends SGraphItem {
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
|
- this.curIndex = -1;
|
|
|
- this.curPoint = null;
|
|
|
+ // this.curIndex = -1;
|
|
|
+ // this.curPoint = null;
|
|
|
return true;
|
|
|
} // Function onMouseMove()
|
|
|
|
|
@@ -272,11 +272,15 @@ export class SPolylineItem extends SGraphItem {
|
|
|
* @param event 事件参数
|
|
|
*/
|
|
|
onKeyUp(event: KeyboardEvent): void {
|
|
|
- if (event.keyCode == 13) {
|
|
|
+ if (event.keyCode == SKeyCode.Enter) {
|
|
|
this.status = SItemStatus.Normal;
|
|
|
this.releaseItem();
|
|
|
this.$emit("finishCreated");
|
|
|
}
|
|
|
+ // delete删除点
|
|
|
+ if (event.keyCode == SKeyCode.Delete && this.status == SItemStatus.Edit) {
|
|
|
+ this.delPoint(this.curIndex);
|
|
|
+ }
|
|
|
} // Function onKeyUp()
|
|
|
|
|
|
/**
|