mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Unbox project data in Project#importJSON(), as we don't want to create a new project object.
This commit is contained in:
parent
4e6f52c20c
commit
85920bbdb8
1 changed files with 4 additions and 0 deletions
|
@ -266,6 +266,10 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
|
|||
// DOCS: Figure out a way to group these together with importSVG / exportSVG
|
||||
|
||||
importJSON: function(json) {
|
||||
json = typeof json === 'string' ? JSON.parse(json) : json;
|
||||
// Unbox project data, as we don't want to create a new project object.
|
||||
if (json[0] === 'Project')
|
||||
json = json[1];
|
||||
return Base.importJSON(json);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue