mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 03:24:23 +08:00
finished custom shape serialization with new attrs structure
This commit is contained in:
@@ -191,6 +191,7 @@ Kinetic.Stage.prototype = {
|
||||
function addNode(node) {
|
||||
var obj = {};
|
||||
obj.attrs = node.attrs;
|
||||
|
||||
obj.nodeType = node.nodeType;
|
||||
obj.shapeType = node.shapeType;
|
||||
|
||||
@@ -215,7 +216,7 @@ Kinetic.Stage.prototype = {
|
||||
function loadNode(node, obj) {
|
||||
// if custom shape then set draw function
|
||||
if(obj.nodeType === 'Shape' && obj.shapeType === undefined) {
|
||||
node.drawFunc = drawFuncs[obj.drawFuncName];
|
||||
node.drawFunc = drawFuncs[obj.attrs.drawFuncName];
|
||||
}
|
||||
|
||||
var children = obj.children;
|
||||
|
||||
Reference in New Issue
Block a user