diff --git a/src/core/Base.js b/src/core/Base.js index 208eacca..05932ab0 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -393,7 +393,8 @@ Base.inject(/** @lends Base# */{ * first */ deserialize: function(json, create, _data) { - var res = json; + var res = json, + isRoot = !_data; // A _data side-car to deserialize that can hold any kind of // 'global' data across a deserialization. It's currently only used // to hold dictionary definitions. @@ -438,7 +439,10 @@ Base.inject(/** @lends Base# */{ for (var key in json) res[key] = Base.deserialize(json[key], create, _data); } - return res; + // Filter out deserialized dictionary. + return isRoot && json && json.length && json[0][0] === 'dictionary' + ? res[1] + : res; }, exportJSON: function(obj, options) { diff --git a/src/item/Item.js b/src/item/Item.js index e123bea3..cd3ca661 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1172,10 +1172,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ return this._applyMatrix; }, - setApplyMatrix: function(transform) { + setApplyMatrix: function(apply) { // Tell #transform() to apply the internal matrix if _applyMatrix // can be set to true. - if (this._applyMatrix = this._canApplyMatrix && !!transform) + if (this._applyMatrix = this._canApplyMatrix && !!apply) this.transform(null, true); },