mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 03:24:23 +08:00
fixed up some issues with serialization and deserialization and updated unit tests
This commit is contained in:
@@ -27,7 +27,10 @@ Kinetic.Shape = function(config) {
|
||||
shadow: {
|
||||
blur: 10,
|
||||
alpha: 1,
|
||||
offset: [0, 0]
|
||||
offset: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
13
src/Stage.js
13
src/Stage.js
@@ -182,7 +182,18 @@ Kinetic.Stage.prototype = {
|
||||
|
||||
function addNode(node) {
|
||||
var obj = {};
|
||||
obj.attrs = node.attrs;
|
||||
|
||||
var cleanAttrs = node.attrs;
|
||||
|
||||
// remove function, image, and DOM attrs
|
||||
for (var key in cleanAttrs) {
|
||||
var val = cleanAttrs[key];
|
||||
if (go._isFunction(val) || go._isElement(val)) {
|
||||
cleanAttrs[key] = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
obj.attrs = cleanAttrs;
|
||||
|
||||
obj.nodeType = node.nodeType;
|
||||
obj.shapeType = node.shapeType;
|
||||
|
||||
Reference in New Issue
Block a user