Skip to content

Commit

Permalink
React UI: batch of fixes (#1462)
Browse files Browse the repository at this point in the history
* CVAT new UI: add arrows on a mouse cursor
* Delete point bug (in new UI)
  • Loading branch information
ActiveChooN authored Apr 24, 2020
1 parent 191d15e commit 176dc71
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Annotation uploading fails in annotation view (<https://github.com/opencv/cvat/pull/1445>)
- UI freezes after canceling pasting with escape (<https://github.com/opencv/cvat/pull/1445>)
- Duplicating keypoints in COCO export (https://github.com/opencv/cvat/pull/1435)
- CVAT new UI: add arrows on a mouse cursor (<https://github.com/opencv/cvat/pull/1391>)
- Delete point bug (in new UI) (<https://github.com/opencv/cvat/pull/1440>)

### Security
-
Expand Down
20 changes: 20 additions & 0 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class CanvasPointContextMenuContainer extends React.PureComponent<Props, State>
}

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;
}
Expand Down

0 comments on commit 176dc71

Please sign in to comment.