SVGJS_VERSION = '0.1'
-DEFAULT_MODULES = %w[ svg container object element document defs group clip_path shape rect circle ellipse path image ]
+DEFAULT_MODULES = %w[ svg container object element document defs shape rect circle ellipse path image group clip_path ]
KILO = 1024 # how many bytes in a "kilobyte"
// get parent svg wrapper
SVG.Element.prototype.parentSVG = function() {
- return this._findParent(SVG.Nested) || this.parentDoc();
+ return this.parentDoc();
};
// set svg element attribute
return e;
};
-// include the dispatcher object
-SVG.Element.include(SVG.Dispatcher);
-
-
// set fill color and opacity
SVG.Shape.prototype.fill = function(fill) {
- this._formatColor(fill);
-
if (fill.color != null)
this.setAttribute('fill', fill.color);
// set stroke color and opacity
SVG.Shape.prototype.stroke = function(stroke) {
- this._formatColor(stroke);
-
if (stroke.color != null)
this.setAttribute('stroke', stroke.color);
this.fill({ opacity: 0 });
return this;
-};
-
-// ensure correct color string
-SVG.Shape.prototype._formatColor = function(obj) {
- if (typeof obj.color === 'number') {
- obj.color = '' + obj.color.toString(16);
- while (obj.color.length < 6)
- obj.color = '0' + obj.color;
-
- return obj.color = '#' + obj.color;
- }
};
\ No newline at end of file