mirror of
https://github.com/konvajs/konva.git
synced 2025-12-04 19:08:24 +08:00
new getAttrs() method
This commit is contained in:
10
src/Stage.js
10
src/Stage.js
@@ -183,7 +183,7 @@ Kinetic.Stage.prototype = {
|
||||
addLayer(0);
|
||||
},
|
||||
/**
|
||||
* serialize stage and children as JSON object
|
||||
* serialize stage and children as a JSON object
|
||||
*/
|
||||
toJSON: function() {
|
||||
var go = Kinetic.GlobalObject;
|
||||
@@ -210,7 +210,13 @@ Kinetic.Stage.prototype = {
|
||||
return JSON.stringify(addNode(this));
|
||||
},
|
||||
/**
|
||||
* load stage with JSON string
|
||||
* load stage with JSON string. De-serializtion does not generate custom
|
||||
* shape drawing functions, images, or event handlers (this would make the
|
||||
* serialized object huge). If your app uses custom shapes, images, and
|
||||
* event handlers (it probably does), then you need to select the appropriate
|
||||
* shapes after loading the stage and set these properties via on(), setDrawFunc(),
|
||||
* and setImage()
|
||||
* @param {String} JSON string
|
||||
*/
|
||||
load: function(json) {
|
||||
function loadNode(node, obj) {
|
||||
|
||||
Reference in New Issue
Block a user