summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-06-09 11:37:26 +0100
committerwout <wout@impinc.co.uk>2013-06-09 11:37:26 +0100
commit8f03d84e43681ecca20ac028071e51a2e2bbc0c8 (patch)
treef5c11dc6c429e8459c20731ba775fa6ca794400f /src/element.js
parentec75128ec31aa055aca2ae7f95ad4f5cf38d12e0 (diff)
downloadsvg.js-8f03d84e43681ecca20ac028071e51a2e2bbc0c8.tar.gz
svg.js-8f03d84e43681ecca20ac028071e51a2e2bbc0c8.zip
Added deep traversing, reorganizd modules
Diffstat (limited to 'src/element.js')
-rw-r--r--src/element.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js
index 8d07762..3fa456f 100644
--- a/src/element.js
+++ b/src/element.js
@@ -140,6 +140,10 @@ SVG.extend(SVG.Element, {
return this.style(v)
} else {
+ /* process gradient or pattern fill */
+ if (typeof v.fill === 'function')
+ v = v.fill()
+
/* treat x differently on text elements */
if (a == 'x' && Array.isArray(this.lines))
for (n = this.lines.length - 1; n >= 0; n--)
@@ -154,7 +158,7 @@ SVG.extend(SVG.Element, {
/* ensure hex color */
if (SVG.Color.test(v) || SVG.Color.isRgb(v))
v = new SVG.Color(v).toHex()
-
+
/* set give attribute on node */
n != null ?
this.node.setAttributeNS(n, a, v) :