From c58a27480084b7630554f6c241a0e1c403786ce5 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 4 Apr 2022 18:14:01 +0300 Subject: [PATCH] _shouldSetNestedCoords --- src/shapes/active_selection.class.js | 6 ++++++ src/shapes/group.class.js | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/shapes/active_selection.class.js b/src/shapes/active_selection.class.js index eff9a1f8585..89e24917fb5 100644 --- a/src/shapes/active_selection.class.js +++ b/src/shapes/active_selection.class.js @@ -52,6 +52,12 @@ this.setCoords(); }, + /** + * @private + */ + _shouldSetNestedCoords: function () { + return true; + }, /** * @private diff --git a/src/shapes/group.class.js b/src/shapes/group.class.js index bf592435890..e87a6922326 100644 --- a/src/shapes/group.class.js +++ b/src/shapes/group.class.js @@ -129,6 +129,13 @@ return this; }, + /** + * @private + */ + _shouldSetNestedCoords: function () { + return this.subTargetCheck; + }, + /** * Add objects * @param {...fabric.Object} objects @@ -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); @@ -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(); }); },