CanvasShape.js revision 9cc2c5945426b2b79c0a258026d750be74795924
this._updateNodePosition(x, y);
_getDefaultFill: function() {
_getDefaultStroke: function()
createNode: function()
this._miterlimit = null;
this._dashstyle = (dashstyle && Y.Lang.isArray(dashstyle) && dashstyle.length > 1) ? dashstyle : null;
if (weight)
if (opacity) {
set: function()
var host = this,
else if(color)
this._fillColor = null;
translate: function(x, y)
this._translateX = x;
this._translateY = y;
_translate: function(x, y)
skewX: function(x)
skewY: function(y)
matrix: function(a, b, c, d, e, f)
if(!this._transformArgs)
this._transformArgs = {};
if(this.initialized)
this._updateTransform();
_updateTransform: function()
key,
args,
val,
transform = node.style.MozTransform || node.style.webkitTransform || node.style.msTransform || node.style.OTransform,
test,
if(transform)
_updateHandler: function()
this._draw();
this._updateTransform();
_draw: function()
this.clear();
this._paint();
_paint: function()
if(!this._methods)
methods = [],
args,
if(this._methods)
for(; i < len; ++i)
if(method)
if (this._fillType)
if (this._stroke) {
if(this._strokeWeight)
if(this._miterlimit)
this._drawingComplete = true;
this._clearAndUpdateCoords();
this._updateNodePosition();
clear: function() {
this._initProps();
if(this.node)
getBounds: function()
right = x + w,
bottom = y + h,
tlx,
tly,
blx,
bly,
brx,
bry,
trx,
trY,
bounds = {},
return bounds;
* Returns the x coordinate for a bounding box's corner based on the corner's original x/y coordinates, rotation and transform origin of the rotation.
* Returns the y coordinate for a bounding box's corner based on the corner's original x/y coordinates, rotation and transform origin of the rotation.
destroy: function()
if(node)
if(context)
* An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a
valueFn: function()
rotation: {
getter: function()
return this._rotation;
translateX: {
getter: function()
return this._translateX;
return val;
translateY: {
getter: function()
return this._translateY;
return val;
node: {
readOnly: true,
getter: function()
return this.node;
id: {
valueFn: function()
return Y.guid();
if(node)
return val;
width: {
height: {
visible: {
value: true,
return val;
* <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
* <p>If a gradient (linear or radial) is specified as the fill type. The following properties are used:
* <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE <= 8</dd>
fill: {
var fill,
return fill;
* <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
* <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to "none", a solid stroke is drawn. When set to an array, the first index indicates the
stroke: {
return val;
autoSize: {
value: false
graphic: {
readOnly: true,
getter: function()
return this._graphic;