|
|
|
@ -1,4 +1,5 @@
|
|
|
|
// Copyright (C) 2021-2022 Intel Corporation
|
|
|
|
// Copyright (C) 2021-2022 Intel Corporation
|
|
|
|
|
|
|
|
// Copyright (C) 2022 CVAT.ai Corporation
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
|
|
|
|
@ -105,10 +106,7 @@ export default function CanvasContextMenu(props: Props): JSX.Element | null {
|
|
|
|
left={left}
|
|
|
|
left={left}
|
|
|
|
latestComments={latestComments}
|
|
|
|
latestComments={latestComments}
|
|
|
|
onClick={(param: MenuInfo) => {
|
|
|
|
onClick={(param: MenuInfo) => {
|
|
|
|
const [state] = objectStates.filter(
|
|
|
|
const state = objectStates.find((_state: any): boolean => _state.clientID === contextMenuClientID);
|
|
|
|
(_state: any): boolean => _state.clientID === contextMenuClientID,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (param.key === ReviewContextMenuKeys.OPEN_ISSUE) {
|
|
|
|
|
|
|
|
if (state) {
|
|
|
|
if (state) {
|
|
|
|
let { points } = state;
|
|
|
|
let { points } = state;
|
|
|
|
if (['ellipse', 'rectangle'].includes(state.shapeType)) {
|
|
|
|
if (['ellipse', 'rectangle'].includes(state.shapeType)) {
|
|
|
|
@ -132,22 +130,17 @@ export default function CanvasContextMenu(props: Props): JSX.Element | null {
|
|
|
|
].map(([x, y]: number[]) => rotatePoint(x, y, state.rotation, cx, cy)).flat();
|
|
|
|
].map(([x, y]: number[]) => rotatePoint(x, y, state.rotation, cx, cy)).flat();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (param.key === ReviewContextMenuKeys.OPEN_ISSUE) {
|
|
|
|
onStartIssue(points);
|
|
|
|
onStartIssue(points);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (param.key === ReviewContextMenuKeys.QUICK_ISSUE_POSITION) {
|
|
|
|
} else if (param.key === ReviewContextMenuKeys.QUICK_ISSUE_POSITION) {
|
|
|
|
if (state) {
|
|
|
|
openIssue(points, consts.QUICK_ISSUE_INCORRECT_POSITION_TEXT);
|
|
|
|
openIssue(state.points, consts.QUICK_ISSUE_INCORRECT_POSITION_TEXT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (param.key === ReviewContextMenuKeys.QUICK_ISSUE_ATTRIBUTE) {
|
|
|
|
} else if (param.key === ReviewContextMenuKeys.QUICK_ISSUE_ATTRIBUTE) {
|
|
|
|
if (state) {
|
|
|
|
openIssue(points, consts.QUICK_ISSUE_INCORRECT_ATTRIBUTE_TEXT);
|
|
|
|
openIssue(state.points, consts.QUICK_ISSUE_INCORRECT_ATTRIBUTE_TEXT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (
|
|
|
|
} else if (
|
|
|
|
param.keyPath.length === 2 &&
|
|
|
|
param.keyPath.length === 2 &&
|
|
|
|
param.keyPath[1] === ReviewContextMenuKeys.QUICK_ISSUE_FROM_LATEST
|
|
|
|
param.keyPath[1] === ReviewContextMenuKeys.QUICK_ISSUE_FROM_LATEST
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (state) {
|
|
|
|
openIssue(points, latestComments[+param.keyPath[0]]);
|
|
|
|
openIssue(state.points, latestComments[+param.keyPath[0]]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
|