diff options
author | wout <wout@impinc.co.uk> | 2013-01-02 18:21:37 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-01-02 18:21:37 +0100 |
commit | 0da8f1d9c9794155c29b8e8f9a0b5ca940061033 (patch) | |
tree | 41ca64065f41b90bece3e93be7ec30a3fa517b09 /src | |
parent | 88987d60c456f1e686edd226f4ccb45e35142cd7 (diff) | |
download | svg.js-0da8f1d9c9794155c29b8e8f9a0b5ca940061033.tar.gz svg.js-0da8f1d9c9794155c29b8e8f9a0b5ca940061033.zip |
Added SVG.Nested to create nested svg documents
Diffstat (limited to 'src')
-rw-r--r-- | src/container.js | 5 | ||||
-rw-r--r-- | src/nested.js | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/container.js b/src/container.js index 86c2827..3d19173 100644 --- a/src/container.js +++ b/src/container.js @@ -116,6 +116,11 @@ SVG.Container = { return this.put(new SVG.Text().text(t)); }, + // create nested svg document + nested: function(s) { + return this.put(new SVG.Nested()); + }, + // create element in defs gradient: function(t, b) { return this.defs().gradient(t, b); diff --git a/src/nested.js b/src/nested.js new file mode 100644 index 0000000..a2944c1 --- /dev/null +++ b/src/nested.js @@ -0,0 +1,11 @@ + +SVG.Nested = function Nested() { + this.constructor.call(this, SVG.create('svg')); + this.attr('overflow', 'visible'); +}; + +// inherit from SVG.Element +SVG.Nested.prototype = new SVG.Element(); + +// include the container object +SVG.extend(SVG.Nested, SVG.Container);
\ No newline at end of file |