aboutsummaryrefslogtreecommitdiffstats
path: root/src/container.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-20 21:31:17 +0100
committerwout <wout@impinc.co.uk>2012-12-20 21:31:17 +0100
commit675e347a10372a10ecdfd4fa6624c062f1ee7102 (patch)
treed36b605512862178deb07a1d58a11dc4e794921b /src/container.js
parent7b5c91ba593fc673ec6d4a8d7dac4b26b1fac52f (diff)
downloadsvg.js-675e347a10372a10ecdfd4fa6624c062f1ee7102.tar.gz
svg.js-675e347a10372a10ecdfd4fa6624c062f1ee7102.zip
Added font element
Diffstat (limited to 'src/container.js')
-rw-r--r--src/container.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/container.js b/src/container.js
index d24fe17..a6eeb93 100644
--- a/src/container.js
+++ b/src/container.js
@@ -101,6 +101,10 @@ SVG.Container = {
return this.place(new SVG.Image(), v);
},
+ text: function(v) {
+ return this.place(new SVG.Text(), v);
+ },
+
place: function(e, v) {
if (v != null) {
if (v.x != null && v.y != null)
@@ -109,11 +113,13 @@ SVG.Container = {
if (v.width != null && v.height != null)
e.size(v.width, v.height);
- if (v.data != null)
- e.data(v.data);
-
- if (v.src != null)
- e.load(v.src);
+ v.data != null ?
+ e.data(v.data) :
+ v.src != null ?
+ e.load(v.src) :
+ v.text != null ?
+ e.text(v.text) :
+ void 0;
}
this.add(e);