Skip to content

Commit

Permalink
_shouldSetNestedCoords
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Apr 4, 2022
1 parent d8f8251 commit c58a274
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/shapes/active_selection.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
this.setCoords();
},

/**
* @private
*/
_shouldSetNestedCoords: function () {
return true;
},

/**
* @private
Expand Down
11 changes: 9 additions & 2 deletions src/shapes/group.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@
return this;
},

/**
* @private
*/
_shouldSetNestedCoords: function () {
return this.subTargetCheck;
},

/**
* Add objects
* @param {...fabric.Object} objects
Expand Down Expand Up @@ -268,7 +275,7 @@
)
);
}
object.setCoords();
this._shouldSetNestedCoords() && object.setCoords();
object._set('group', this);
object._set('canvas', this.canvas);
this.interactive && this._watchObject(true, object);
Expand Down Expand Up @@ -439,7 +446,7 @@
*/
setCoords: function () {
this.callSuper('setCoords');
(this.subTargetCheck || this.type === 'activeSelection') && this.forEachObject(function (object) {
this._shouldSetNestedCoords() && this.forEachObject(function (object) {
object.setCoords();
});
},
Expand Down

0 comments on commit c58a274

Please sign in to comment.