Fixed bug: 'Cannot read property each of undefined', fixed points size (#2307)

* Fixed bug: 'Cannot read property each of undefined', fixed points size

* Updated version, updated changelog
main
Boris Sekachev 5 years ago committed by GitHub
parent 796a8d3f54
commit df6e6fd3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Git application name (renamed to dataset_repo) (<https://github.com/openvinotoolkit/cvat/pull/2243>)
- A problem in exporting of tracks, where tracks could be truncated (<https://github.com/openvinotoolkit/cvat/issues/2129>)
- Fixed CVAT startup process if the user has `umask 077` in .bashrc file (<https://github.com/openvinotoolkit/cvat/pull/2293>)
- Exception: Cannot read property "each" of undefined after drawing a single point (<https://github.com/openvinotoolkit/cvat/pull/2307>)
### Security

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

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

@ -311,12 +311,16 @@ export class DrawHandlerImpl implements DrawHandler {
const sizeDecrement = (): void => {
if (--size === 0) {
this.drawInstance.draw('done');
// we need additional settimeout because we cannot invoke draw('done')
// from event listener for drawstart event
// because of implementation of svg.js
setTimeout((): void => this.drawInstance.draw('done'));
}
};
this.drawInstance.on('drawstart', sizeDecrement);
this.drawInstance.on('drawpoint', sizeDecrement);
this.drawInstance.on('drawupdate', (): void => this.transform(this.geometry));
this.drawInstance.on('undopoint', (): number => size++);
// Add ability to cancel the latest drawn point

@ -122,7 +122,8 @@ export class EditHandlerImpl implements EditHandler {
this.transform(this.geometry);
lastDrawnPoint.x = e.detail.event.clientX;
lastDrawnPoint.y = e.detail.event.clientY;
}).draw(dummyEvent, { snapToGrid: 0.1 });
}).on('drawupdate', (): void => this.transform(this.geometry))
.draw(dummyEvent, { snapToGrid: 0.1 });
if (this.editData.state.shapeType === 'points') {
this.editLine.attr('stroke-width', 0);

Loading…
Cancel
Save