Skip to content

Commit

Permalink
Do not access group property from the object (fabricjs#5257)
Browse files Browse the repository at this point in the history
use the group reference
  • Loading branch information
asturur authored Sep 22, 2018
1 parent 17efc45 commit e34a0c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shapes/group.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,10 @@
* @return {Object} object representation of an instance
*/
toObject: function(propertiesToInclude) {
var _includeDefaultValues = this.includeDefaultValues;
var objsToObject = this._objects.map(function(obj) {
var originalDefaults = obj.includeDefaultValues;
obj.includeDefaultValues = obj.group.includeDefaultValues;
obj.includeDefaultValues = _includeDefaultValues;
var _obj = obj.toObject(propertiesToInclude);
obj.includeDefaultValues = originalDefaults;
return _obj;
Expand All @@ -253,9 +254,10 @@
objsToObject = sourcePath;
}
else {
var _includeDefaultValues = this.includeDefaultValues;
objsToObject = this._objects.map(function(obj) {
var originalDefaults = obj.includeDefaultValues;
obj.includeDefaultValues = obj.group.includeDefaultValues;
obj.includeDefaultValues = _includeDefaultValues;
var _obj = obj.toDatalessObject(propertiesToInclude);
obj.includeDefaultValues = originalDefaults;
return _obj;
Expand Down

0 comments on commit e34a0c3

Please sign in to comment.