mirror of
https://github.com/konvajs/konva.git
synced 2025-12-04 10:58:22 +08:00
finished custom shape serialization with new attrs structure
This commit is contained in:
6
dist/kinetic-core.js
vendored
6
dist/kinetic-core.js
vendored
@@ -1121,6 +1121,7 @@ Kinetic.Stage.prototype = {
|
||||
function addNode(node) {
|
||||
var obj = {};
|
||||
obj.attrs = node.attrs;
|
||||
|
||||
obj.nodeType = node.nodeType;
|
||||
obj.shapeType = node.shapeType;
|
||||
|
||||
@@ -1145,7 +1146,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;
|
||||
@@ -1928,11 +1929,10 @@ Kinetic.Shape = function(config) {
|
||||
this.attrs.strokeWidth = undefined;
|
||||
this.attrs.lineJoin = undefined;
|
||||
this.attrs.detectionType = 'path';
|
||||
this.attrs.drawFuncName = undefined;
|
||||
|
||||
// special
|
||||
this.drawFunc = config.drawFunc;
|
||||
|
||||
|
||||
this.data = [];
|
||||
this.nodeType = 'Shape';
|
||||
|
||||
|
||||
6
dist/kinetic-core.min.js
vendored
6
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user