aboutsummaryrefslogtreecommitdiffstats
path: root/src/container.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/container.js')
-rw-r--r--src/container.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/container.js b/src/container.js
index 3656892..86c2827 100644
--- a/src/container.js
+++ b/src/container.js
@@ -36,7 +36,7 @@ SVG.Container = {
c = this.children();
// iteralte all shapes
- for (i = 1, l = c.length; i < l; i++)
+ for (i = 0, l = c.length; i < l; i++)
if (c[i] instanceof SVG.Shape)
b.apply(c[i], [i, c]);
@@ -92,17 +92,17 @@ SVG.Container = {
// create a polyline element
polyline: function(p) {
- return this.put(new SVG.Polyline().plot(p));
+ return this.put(new Wrap(new SVG.Polyline())).plot(p);
},
// create a polygon element
polygon: function(p) {
- return this.put(new SVG.Polygon().plot(p));
+ return this.put(new Wrap(new SVG.Polygon())).plot(p);
},
- // create a path element
+ // create a wrapped path element
path: function(d) {
- return this.put(new SVG.Path().plot(d));
+ return this.put(new Wrap(new SVG.Path())).plot(d);
},
// create image element, load image and set its size
@@ -121,6 +121,11 @@ SVG.Container = {
return this.defs().gradient(t, b);
},
+ // create masking element
+ mask: function() {
+ return this.defs().put(new SVG.Mask());
+ },
+
// get first child, skipping the defs node
first: function() {
return this.children()[1];