aboutsummaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
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) :