From 176dc718a2a4c5355369456353c94a28dfae5f57 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 24 Apr 2020 17:26:33 +0300 Subject: [PATCH] React UI: batch of fixes (#1462) * CVAT new UI: add arrows on a mouse cursor * Delete point bug (in new UI) --- CHANGELOG.md | 2 ++ cvat-canvas/src/scss/canvas.scss | 20 +++++++++++++++++++ cvat-canvas/src/typescript/canvasView.ts | 2 ++ .../canvas-point-context-menu.tsx | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c78f0784741..cb533494cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Annotation uploading fails in annotation view () - UI freezes after canceling pasting with escape () - Duplicating keypoints in COCO export (https://github.com/opencv/cvat/pull/1435) +- CVAT new UI: add arrows on a mouse cursor () +- Delete point bug (in new UI) () ### Security - diff --git a/cvat-canvas/src/scss/canvas.scss b/cvat-canvas/src/scss/canvas.scss index 2f8a081cf3b..537ebe68494 100644 --- a/cvat-canvas/src/scss/canvas.scss +++ b/cvat-canvas/src/scss/canvas.scss @@ -126,6 +126,26 @@ polyline.cvat_canvas_shape_splitting { pointer-events: none; } +.svg_select_points_lb:hover, .svg_select_points_rt:hover { + cursor: nesw-resize; +} + +.svg_select_points_lt:hover, .svg_select_points_rb:hover { + cursor: nwse-resize; +} + +.svg_select_points_l:hover, .svg_select_points_r:hover { + cursor: ew-resize; +} + +.svg_select_points_t:hover, .svg_select_points_b:hover { + cursor: ns-resize; +} + +.cvat_canvas_shape_draggable:hover { + cursor: move; +} + #cvat_canvas_wrapper { width: calc(100% - 10px); height: calc(100% - 10px); diff --git a/cvat-canvas/src/typescript/canvasView.ts b/cvat-canvas/src/typescript/canvasView.ts index 4fbdadeb41d..ffffdce42c6 100644 --- a/cvat-canvas/src/typescript/canvasView.ts +++ b/cvat-canvas/src/typescript/canvasView.ts @@ -1190,6 +1190,7 @@ export class CanvasViewImpl implements CanvasView, Listener { const shape = this.svgShapes[clientID]; shape.removeClass('cvat_canvas_shape_activated'); + shape.removeClass('cvat_canvas_shape_draggable'); if (!drawnState.pinned) { (shape as any).off('dragstart'); @@ -1281,6 +1282,7 @@ export class CanvasViewImpl implements CanvasView, Listener { } if (!state.pinned) { + shape.addClass('cvat_canvas_shape_draggable'); (shape as any).draggable().on('dragstart', (): void => { this.mode = Mode.DRAG; if (text) { diff --git a/cvat-ui/src/containers/annotation-page/standard-workspace/canvas-point-context-menu.tsx b/cvat-ui/src/containers/annotation-page/standard-workspace/canvas-point-context-menu.tsx index 5db5363c037..9dd2975b497 100644 --- a/cvat-ui/src/containers/annotation-page/standard-workspace/canvas-point-context-menu.tsx +++ b/cvat-ui/src/containers/annotation-page/standard-workspace/canvas-point-context-menu.tsx @@ -104,7 +104,7 @@ class CanvasPointContextMenuContainer extends React.PureComponent } if (typeof state.activatedStateID !== typeof props.activatedStateID - || typeof state.activatedPointID !== typeof props.activatedPointID) { + || state.activatedPointID !== props.activatedPointID) { newState.activatedStateID = props.activatedStateID; newState.activatedPointID = props.activatedPointID; }