diff --git a/src/mixins/canvas_grouping.mixin.js b/src/mixins/canvas_grouping.mixin.js index 040d5628e61..c6f0d9420a3 100644 --- a/src/mixins/canvas_grouping.mixin.js +++ b/src/mixins/canvas_grouping.mixin.js @@ -40,10 +40,6 @@ else { this._createActiveGroup(target, e); } - - if (this._activeGroup) { - this._activeGroup.saveCoords(); - } }, /** @@ -126,7 +122,6 @@ }); group.addWithUpdate(); this.setActiveGroup(group, e); - group.saveCoords(); this.fire('selection:created', { target: group, e: e }); this.renderAll(); } diff --git a/src/shapes/group.class.js b/src/shapes/group.class.js index 7a03cfeecf8..01c1535a0b4 100644 --- a/src/shapes/group.class.js +++ b/src/shapes/group.class.js @@ -95,7 +95,6 @@ } this.setCoords(); - this.saveCoords(); }, /** @@ -464,27 +463,6 @@ return this._restoreObjectsState(); }, - /** - * Saves coordinates of this instance (to be used together with `hasMoved`) - * @saveCoords - * @return {fabric.Group} thisArg - * @chainable - */ - saveCoords: function() { - this._originalLeft = this.get('left'); - this._originalTop = this.get('top'); - return this; - }, - - /** - * Checks whether this group was moved (since `saveCoords` was called last) - * @return {Boolean} true if an object was moved (since fabric.Group#saveCoords was called) - */ - hasMoved: function() { - return this._originalLeft !== this.get('left') || - this._originalTop !== this.get('top'); - }, - /** * Sets coordinates of all objects inside group * @return {fabric.Group} thisArg diff --git a/test/unit/group.js b/test/unit/group.js index 7a124573776..0f19778cdc3 100644 --- a/test/unit/group.js +++ b/test/unit/group.js @@ -305,30 +305,6 @@ equal(firstObject.get('top'), initialTopValue, 'should restore initial top value'); }); - test('saveCoords', function() { - var group = makeGroupWith2Objects(); - - ok(typeof group.saveCoords == 'function'); - equal(group.saveCoords(), group, 'should be chainable'); - }); - - test('hasMoved', function() { - var group = makeGroupWith2Objects(); - - ok(typeof group.hasMoved == 'function'); - equal(group.hasMoved(), false); - - function moveBy10(value) { - return value + 10; - } - group.set('left', moveBy10); - equal(group.hasMoved(), true); - group.saveCoords(); - equal(group.hasMoved(), false); - group.set('top', moveBy10); - equal(group.hasMoved(), true); - }); - test('setObjectCoords', function(){ var group = makeGroupWith2Objects();