Using "alt" instead of "ctrl" to delete a point, fixed reducer (#2204)

* Using alt instead of ctrl to delete a point, fixed reducer

* Updated versions

* Updated changelog
main
Boris Sekachev 5 years ago committed by GitHub
parent 4a8095914d
commit 4d869c3cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- UI models (like DEXTR) were redesigned to be more interactive (<https://github.com/opencv/cvat/pull/2054>) - UI models (like DEXTR) were redesigned to be more interactive (<https://github.com/opencv/cvat/pull/2054>)
- Used Ubuntu:20.04 as a base image for CVAT Dockerfile (<https://github.com/opencv/cvat/pull/2101>) - Used Ubuntu:20.04 as a base image for CVAT Dockerfile (<https://github.com/opencv/cvat/pull/2101>)
- Right colors of label tags in label mapping when a user runs automatic detection (<https://github.com/openvinotoolkit/cvat/pull/2162>) - Right colors of label tags in label mapping when a user runs automatic detection (<https://github.com/openvinotoolkit/cvat/pull/2162>)
- A key to remove a point from a polyshape [Ctrl => Alt] (<https://github.com/openvinotoolkit/cvat/pull/2204>)
### Deprecated ### Deprecated
- -

@ -1,6 +1,6 @@
{ {
"name": "cvat-canvas", "name": "cvat-canvas",
"version": "2.1.0", "version": "2.1.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-canvas", "name": "cvat-canvas",
"version": "2.1.0", "version": "2.1.1",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library", "description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts", "main": "src/canvas.ts",
"scripts": { "scripts": {

@ -642,7 +642,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
)); ));
if (['polygon', 'polyline', 'points'].includes(state.shapeType)) { if (['polygon', 'polyline', 'points'].includes(state.shapeType)) {
if (e.ctrlKey) { if (e.altKey) {
const { points } = state; const { points } = state;
self.onEditDone( self.onEditDone(
state, state,
@ -897,7 +897,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
// Setup event handlers // Setup event handlers
this.content.addEventListener('dblclick', (e: MouseEvent): void => { this.content.addEventListener('dblclick', (e: MouseEvent): void => {
if (e.ctrlKey || e.shiftKey) return;
self.controller.fit(); self.controller.fit();
e.preventDefault(); e.preventDefault();
}); });
@ -933,7 +932,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
self.controller.drag(e.clientX, e.clientY); self.controller.drag(e.clientX, e.clientY);
if (this.mode !== Mode.IDLE) return; if (this.mode !== Mode.IDLE) return;
if (e.ctrlKey || e.shiftKey) return; if (e.ctrlKey || e.altKey) return;
const { offset } = this.controller.geometry; const { offset } = this.controller.geometry;
const [x, y] = translateToSVG(this.content, [e.clientX, e.clientY]); const [x, y] = translateToSVG(this.content, [e.clientX, e.clientY]);

@ -175,7 +175,7 @@ SVG.Element.prototype.resize = function constructor(...args: any): any {
handler = this.remember('_resizeHandler'); handler = this.remember('_resizeHandler');
handler.resize = function(e: any) { handler.resize = function(e: any) {
const { event } = e.detail; const { event } = e.detail;
if (event.button === 0 && !event.shiftKey && !event.ctrlKey) { if (event.button === 0 && !event.shiftKey && !event.altKey) {
return handler.constructor.prototype.resize.call(this, e); return handler.constructor.prototype.resize.call(this, e);
} }
} }

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.9.5", "version": "1.9.6",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.9.5", "version": "1.9.6",
"description": "CVAT single-page application", "description": "CVAT single-page application",
"main": "src/index.tsx", "main": "src/index.tsx",
"scripts": { "scripts": {

@ -111,7 +111,7 @@ function CanvasPointContextMenu(props: Props): React.ReactPortal | null {
return visible && contextMenuFor && type === ContextMenuType.CANVAS_SHAPE_POINT return visible && contextMenuFor && type === ContextMenuType.CANVAS_SHAPE_POINT
? (ReactDOM.createPortal( ? (ReactDOM.createPortal(
<div className='cvat-canvas-point-context-menu' style={{ top, left }}> <div className='cvat-canvas-point-context-menu' style={{ top, left }}>
<Tooltip title='Delete point [Ctrl + dblclick]' mouseLeaveDelay={0}> <Tooltip title='Delete point [Alt + dblclick]' mouseLeaveDelay={0}>
<Button type='link' icon='delete' onClick={onPointDelete}> <Button type='link' icon='delete' onClick={onPointDelete}>
Delete point Delete point
</Button> </Button>

@ -66,15 +66,26 @@ export default function (
} }
case ModelsActionTypes.GET_INFERENCE_STATUS_SUCCESS: { case ModelsActionTypes.GET_INFERENCE_STATUS_SUCCESS: {
const { inferences } = state; const { inferences } = state;
if (action.payload.activeInference.status === 'finished') { if (action.payload.activeInference.status === 'finished') {
delete inferences[action.payload.taskID]; return {
} else { ...state,
inferences[action.payload.taskID] = action.payload.activeInference; inferences: Object.fromEntries(
Object.entries(inferences)
.filter(([key]): boolean => +key !== action.payload.taskID),
),
};
} }
const update: any = {};
update[action.payload.taskID] = action.payload.activeInference;
return { return {
...state, ...state,
inferences: { ...inferences }, inferences: {
...state.inferences,
...update,
},
}; };
} }
case ModelsActionTypes.GET_INFERENCE_STATUS_FAILED: { case ModelsActionTypes.GET_INFERENCE_STATUS_FAILED: {

Loading…
Cancel
Save