From 01d4f36261a49c1e58d33e231709cca6835cc9f9 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 24 Apr 2020 16:32:03 +0300 Subject: [PATCH 1/2] added correct cursor for shapes and fixed point deletion context menu --- cvat-canvas/src/scss/canvas.scss | 20 +++++++++++++++++++ cvat-canvas/src/typescript/canvasView.ts | 2 ++ .../canvas-point-context-menu.tsx | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cvat-canvas/src/scss/canvas.scss b/cvat-canvas/src/scss/canvas.scss index 2f8a081cf3bb..537ebe68494d 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 4fbdadeb41db..ffffdce42c6f 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 5db5363c037a..9dd2975b4977 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; } From 6c6ace3c19698159aff21e4d39c2aa56a48f8159 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Fri, 24 Apr 2020 16:49:56 +0300 Subject: [PATCH 2/2] added CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d6f5a9aaa8f..3a6aa0183424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,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 -