Add label list edit panel

This commit is contained in:
2022-03-11 17:00:05 +08:00
parent 1b401dda57
commit 7e9a652249
9 changed files with 72 additions and 33 deletions
+19
View File
@@ -32,6 +32,7 @@ interface IStatusEvent {
objectChange: void;
labelChange: void;
rangeAttrChange: void;
labelAttrChange: void;
}
class Status extends Emitter<IStatusEvent> {
@@ -120,6 +121,24 @@ class Status extends Emitter<IStatusEvent> {
}
}
/**
* 修改范围属性
*/
public changeLabelAttrib<K extends keyof Label>
(label: Label, key: K, val: Label[K]) {
let findLabel: Label | undefined;
for (let i = 0; i < this.model.labelPool.length; i++) {
if (this.model.labelPool[i].equal(label)) {
findLabel = this.model.labelPool[i];
break;
}
}
if (findLabel) {
findLabel[key] = val;
this.emit("labelAttrChange");
}
}
/**
* 鼠标工具状态
*/