SVGPath.js revision cec703a844d9691646231634fe709f4ea41d278a
/**
* The SVGPath class creates a shape through the use of drawing methods.
*
* @module graphics
* @class SVGPath
* @extends SVGShape
* @constructor
*/
SVGPath = function(cfg)
{
SVGPath.superclass.constructor.apply(this, arguments);
};
SVGPath.NAME = "svgPath";
Y.extend(SVGPath, Y.SVGShape, {
/**
* Left edge of the path
*
* @property _left
* @type Number
* @private
*/
_left: 0,
/**
* Right edge of the path
*
* @property _right
* @type Number
* @private
*/
_right: 0,
/**
* Top edge of the path
*
* @property _top
* @type Number
* @private
*/
_top: 0,
/**
* Bottom edge of the path
*
* @property _bottom
* @type Number
* @private
*/
_bottom: 0,
/**
* Indicates the type of shape
*
* @property _type
* @readOnly
* @type String
* @private
*/
_type: "path",
/**
* Storage for path
*
* @property _path
* @type String
* @private
*/
_path: ""
});
SVGPath.ATTRS = Y.merge(Y.SVGShape.ATTRS, {
/**
* Path string of the shape
*
* @config path
* @type String
*/
path: {
readOnly: true,
getter: function()
{
return this._path;
}
},
/**
* Indicates the height of the shape
*
* @config height
* @type Number
*/
width: {
getter: function()
{
var val = Math.max(this._right - this._left, 0);
return val;
}
},
/**
* Indicates the height of the shape
*
* @config height
* @type Number
*/
height: {
getter: function()
{
return Math.max(this._bottom - this._top, 0);
}
}
});
Y.SVGPath = SVGPath;