mirror of
https://github.com/konvajs/konva.git
synced 2025-12-21 19:27:08 +08:00
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:
17
src/Node.js
17
src/Node.js
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user