mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
parent
2002c4a3af
commit
48bc34b21f
2 changed files with 8 additions and 4 deletions
|
@ -393,7 +393,8 @@ Base.inject(/** @lends Base# */{
|
||||||
* first
|
* first
|
||||||
*/
|
*/
|
||||||
deserialize: function(json, create, _data) {
|
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
|
// A _data side-car to deserialize that can hold any kind of
|
||||||
// 'global' data across a deserialization. It's currently only used
|
// 'global' data across a deserialization. It's currently only used
|
||||||
// to hold dictionary definitions.
|
// to hold dictionary definitions.
|
||||||
|
@ -438,7 +439,10 @@ Base.inject(/** @lends Base# */{
|
||||||
for (var key in json)
|
for (var key in json)
|
||||||
res[key] = Base.deserialize(json[key], create, _data);
|
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) {
|
exportJSON: function(obj, options) {
|
||||||
|
|
|
@ -1172,10 +1172,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
||||||
return this._applyMatrix;
|
return this._applyMatrix;
|
||||||
},
|
},
|
||||||
|
|
||||||
setApplyMatrix: function(transform) {
|
setApplyMatrix: function(apply) {
|
||||||
// Tell #transform() to apply the internal matrix if _applyMatrix
|
// Tell #transform() to apply the internal matrix if _applyMatrix
|
||||||
// can be set to true.
|
// can be set to true.
|
||||||
if (this._applyMatrix = this._canApplyMatrix && !!transform)
|
if (this._applyMatrix = this._canApplyMatrix && !!apply)
|
||||||
this.transform(null, true);
|
this.transform(null, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue