Skip to content

Commit

Permalink
Merge pull request #525 from Original-Recipe/fixed-resizekeyCtrl4toP
Browse files Browse the repository at this point in the history
fix: Fix the key of resize rect from ctrl+4 to P
  • Loading branch information
lihqi authored Jul 18, 2024
2 parents f5dc658 + 84432d5 commit f742bf0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions packages/lb-annotation/src/constant/keyCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ enum EKeyCode {
Y = 89,
S = 83,
Q = 81,
P = 80,
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.Four, EKeyCode.NumberFour].includes(e.keyCode)) {
if (this.checkMode || ![EKeyCode.Delete, EKeyCode.P].includes(e.keyCode)) {
return;
}

Expand Down
11 changes: 6 additions & 5 deletions packages/lb-annotation/src/core/toolOperation/rectOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ class RectOperation extends BasicToolOperation {
return;
}

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

case EKeyCode.Four:
case EKeyCode.NumberFour: {
if (ctrlKey) {
this.resizeRect();
case EKeyCode.P: {
// Isolation combination key
if (ctrlKey || altKey || shiftKey || metaKey) {
return
}
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: ['Ctrl', '4'],
shortCut: ['P'],
noticeInfo: 'SelectedRect',
};

Expand Down

0 comments on commit f742bf0

Please sign in to comment.