Fixed: Cannot read property 'split' of undefined for interpolation points (#455)

main
Boris Sekachev 7 years ago committed by Nikita Manovich
parent 58e72a2986
commit 80e8a7bf22

@ -951,9 +951,14 @@ class PolyShapeModel extends ShapeModel {
if (this._verifyArea(box)) { if (this._verifyArea(box)) {
if (!silent) { if (!silent) {
// Undo/redo code // Undo/redo code
let oldPos = Object.assign({}, this._positions[frame]); const oldPos = Object.assign({}, this._positions[frame]);
window.cvat.addAction('Change Position', () => { window.cvat.addAction('Change Position', () => {
if (!Object.keys(oldPos).length) {
delete this._positions[frame];
this.notify('position');
} else {
this.updatePosition(frame, oldPos, false); this.updatePosition(frame, oldPos, false);
}
}, () => { }, () => {
this.updatePosition(frame, pos, false); this.updatePosition(frame, pos, false);
}, frame); }, frame);
@ -961,7 +966,7 @@ class PolyShapeModel extends ShapeModel {
} }
if (this._type.startsWith('annotation')) { if (this._type.startsWith('annotation')) {
if (this._frame != frame) { if (this._frame !== frame) {
throw Error(`Got bad frame for annotation poly shape during update position: ${frame}. Own frame is ${this._frame}`); throw Error(`Got bad frame for annotation poly shape during update position: ${frame}. Own frame is ${this._frame}`);
} }
this._positions[frame] = pos; this._positions[frame] = pos;
@ -2979,6 +2984,11 @@ class PolyShapeView extends ShapeView {
}); });
point.on('dblclick.polyshapeEditor', (e) => { point.on('dblclick.polyshapeEditor', (e) => {
if (this._controller.type === 'interpolation_points') {
// Not available for interpolation points
return;
}
if (e.shiftKey) { if (e.shiftKey) {
if (!window.cvat.mode) { if (!window.cvat.mode) {
// Get index before detach shape from DOM // Get index before detach shape from DOM

Loading…
Cancel
Save