removed Circle shape and replaced it with the more flexible Ellipse shape. If you define the radius with a number, the shape will be a circle. if you define the radius with an x and y component, it will be an oval

This commit is contained in:
Eric Rowell
2012-06-17 16:50:04 -07:00
parent a49fc610d6
commit fae1ff6cb7
10 changed files with 644 additions and 570 deletions

View File

@@ -217,6 +217,21 @@ Kinetic.Node.prototype = {
that._setAttr(obj[key], 'x', pos.x);
that._setAttr(obj[key], 'y', pos.y);
break;
case 'radius':
/*
* root attr radius should be an object
* while all other radius attrs should be
* a number
*/
if(level > 0) {
that._setAttr(obj, key, val);
}
else {
var pos = go._getXY(val);
that._setAttr(obj[key], 'x', pos.x);
that._setAttr(obj[key], 'y', pos.y);
}
break;
case 'scale':
var pos = go._getXY(val);
that._setAttr(obj[key], 'x', pos.x);
@@ -234,7 +249,7 @@ Kinetic.Node.prototype = {
that._setAttr(obj[key], 'height', size.height);
break;
default:
that._setAttr(obj, key, c[key]);
that._setAttr(obj, key, val);
break;
}