Skip to content

Commit

Permalink
Merge pull request #524 from Original-Recipe/fixed-resizekeyRtoCtrl4
Browse files Browse the repository at this point in the history
fix: Fix the key of resize rect from R to ctrl+4
  • Loading branch information
lihqi authored Jul 17, 2024
2 parents 7ecae3b + 5d5982f commit 6dec4b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/lb-annotation/src/constant/keyCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ enum EKeyCode {
One = 49,
Two = 50,
Three = 51,
Four = 52,
NumberFour = 100,
Delete = 46,
F11 = 122,
Space = 32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PointCloud2DRectOperation extends RectOperation {
}

public onKeyDown(e: KeyboardEvent) {
if (this.checkMode || ![EKeyCode.Delete, EKeyCode.R].includes(e.keyCode)) {
if (this.checkMode || ![EKeyCode.Delete, EKeyCode.Four, EKeyCode.NumberFour].includes(e.keyCode)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ class RectOperation extends BasicToolOperation {
return;
}

const { keyCode } = e;
const { keyCode, ctrlKey } = e;
switch (keyCode) {
case EKeyCode.Ctrl:
if (this.drawingRect) {
Expand Down Expand Up @@ -1392,8 +1392,11 @@ class RectOperation extends BasicToolOperation {
break;
}

case EKeyCode.R: {
this.resizeRect();
case EKeyCode.Four:
case EKeyCode.NumberFour: {
if (ctrlKey) {
this.resizeRect();
}
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const DeletePoint = {
const Image2DBoxScale = {
name: 'Image2DBoxScale',
icon: Image2DBoxScaleSvg,
shortCut: ['R'],
shortCut: ['Ctrl', '4'],
noticeInfo: 'SelectedRect',
};

Expand Down

0 comments on commit 6dec4b5

Please sign in to comment.