diff options
author | wout <wout@impinc.co.uk> | 2013-02-20 19:10:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-02-20 19:10:03 +0100 |
commit | ae878fd63077d4c95f2de9053a6f0951b55239eb (patch) | |
tree | 5dba7bd42a8b5702faeb6cc12d2b4d4099841e51 /README.md | |
parent | 5020240e4029a61a9620f21d7be4d9764e7723d1 (diff) | |
download | svg.js-ae878fd63077d4c95f2de9053a6f0951b55239eb.tar.gz svg.js-ae878fd63077d4c95f2de9053a6f0951b55239eb.zip |
Created separate classes for SVG.ViewBox anSVG.BBox0.6
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -28,7 +28,9 @@ This will generate the following output: </svg> </div> ``` + By default the svg canvas follows the dimensions of its parent, in this case `#paper`: + ```javascript var draw = svg('paper').size('100%', '100%'); ``` @@ -46,6 +48,20 @@ if (SVG.supported) { } ``` +### ViewBox + +The `viewBox` attribute of an `<svg>` element can be managed with the `viewbox()` method. When supplied with arguments it will act as a setter: + +```javascript +draw.viewbox(0, 0, 297, 210); +``` + +Without any attributes a an instance of `SVG.ViewBox` will be returned: + +```javascript +var box = draw.viewbox(); +``` + ## Elements @@ -274,7 +290,7 @@ draw.clear(); ```javascript path.bbox(); ``` -This will return an object with the following values: +This will return an instance of `SVG.BBox` containing the following values: ```javascript { height: 20, width: 20, y: 20, x: 10, cx: 30, cy: 20 } |