Skip to content

Commit

Permalink
Fixed cuboid perspective change (#2733)
Browse files Browse the repository at this point in the history
* Fixed cuboid perspective change

* Added CHANGELOG and npm version increased
  • Loading branch information
ActiveChooN authored Feb 8, 2021
1 parent 967b8c5 commit 77acd7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The list of files attached to the task is not displayed (<https://github.com/openvinotoolkit/cvat/pul
- A couple of css-related issues (top bar disappear, wrong arrow position on collapse elements) (<https://github.com/openvinotoolkit/cvat/pull/2736>)
- Issue with point region doesn't work in Firefox (<https://github.com/openvinotoolkit/cvat/pull/2727>)
- Fixed cuboid perpective change (<https://github.com/openvinotoolkit/cvat/pull/2733>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "2.3.0",
"version": "2.3.1",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion cvat-canvas/src/typescript/svg.patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ SVG.Element.prototype.resize = function constructor(...args: any): any {
handler = this.remember('_resizeHandler');
handler.resize = function (e: any) {
const { event } = e.detail;
if (event.button === 0 && !event.shiftKey && !event.altKey) {
if (
event.button === 0 &&
// ignore shift key for cuboid change perspective
(!event.shiftKey || this.el.parent().hasClass('cvat_canvas_shape_cuboid')) &&
!event.altKey
) {
return handler.constructor.prototype.resize.call(this, e);
}
};
Expand Down Expand Up @@ -233,6 +238,7 @@ function getTopDown(edgeIndex: EdgeIndex): number[] {
this.hideProjections();

this._attr('points', points);
this.addClass('cvat_canvas_shape_cuboid');
return this;
},

Expand Down

0 comments on commit 77acd7d

Please sign in to comment.