Skip to content

Commit

Permalink
fix: 修复标注工具键盘事件配置未限制的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
laoluo committed Oct 14, 2021
1 parent 60c2497 commit 3402d47
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1536,10 +1536,12 @@ class LineToolOperation extends BasicToolOperation {
}

if (this.isActive) {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(e.keyCode, this.config.attributeList);
if (this.config.attributeConfigurable) {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(e.keyCode, this.config.attributeList);

if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ class PointOperation extends BasicToolOperation {
this.render();
break;
default: {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(keyCode, this.config.attributeList);
if (this.config.attributeConfigurable) {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(keyCode, this.config.attributeList);

if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
}
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,13 @@ class PolygonOperation extends BasicToolOperation {
}

default: {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(keyCode, this.config.attributeList);

if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
if (this.config.attributeConfigurable) {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(keyCode, this.config.attributeList);

if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
}

}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,12 @@ class RectOperation extends BasicToolOperation {
}

default: {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(keyCode, this.config.attributeList);
if (this.config.attributeConfigurable) {
const keyCode2Attribute = AttributeUtils.getAttributeByKeycode(keyCode, this.config.attributeList);

if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
if (keyCode2Attribute !== undefined) {
this.setDefaultAttribute(keyCode2Attribute);
}
}

break;
Expand Down

0 comments on commit 3402d47

Please sign in to comment.