aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-02-04 14:47:49 +0100
committerwout <wout@impinc.co.uk>2014-02-04 14:47:49 +0100
commit43fd91ccce8f9bce60ed7c566e32152be42f9774 (patch)
treef4273e1528a0f8113ef3a56578e06030ae50fb34
parent7cc23196d51a205b73aa73533a7289ec7e68efd5 (diff)
downloadsvg.js-43fd91ccce8f9bce60ed7c566e32152be42f9774.tar.gz
svg.js-43fd91ccce8f9bce60ed7c566e32152be42f9774.zip
Updated README1.0.0-rc.4
-rw-r--r--README.md19
1 files changed, 9 insertions, 10 deletions
diff --git a/README.md b/README.md
index 1047f02..04a9950 100644
--- a/README.md
+++ b/README.md
@@ -2361,9 +2361,10 @@ To create the element in your drawing:
var rounded = draw.rounded(200, 100)
```
-That's, the invention is now ready to be used!
+That's it, the invention is now ready to be used!
-The `SVG.invent()` function always expectes an object. The object accepts the following configuration values:
+#### Accepted values
+The `SVG.invent()` function always expectes an object. The object can have the following configuration values:
- `create`: can be either a string with the node name (e.g. `rect`, `ellipse`, ...) or a custom initializer function; `[required]`
- `inherit`: the desired svg.js class to inherit from (e.g. `SVG.Shape`, `SVG.Element`, `SVG.Container`, `SVG.Rect`, ...); `[optional]`
@@ -2380,7 +2381,7 @@ Svg.js has a modular structure. It is very easy to add you own methods at differ
```javascript
SVG.extend(SVG.Shape, {
paintRed: function() {
- return this.fill({ color: 'red' })
+ return this.fill('red')
}
})
```
@@ -2390,7 +2391,7 @@ Now all shapes will have the paintRed method available. Say we want to have the
```javascript
SVG.extend(SVG.Ellipse, {
paintRed: function() {
- return this.fill({ color: 'orangered' })
+ return this.fill('orangered')
}
})
@@ -2404,11 +2405,9 @@ The SVG document can be extended by using:
```javascript
SVG.extend(SVG.Doc, {
paintAllPink: function() {
- for (var i = 0, l = this.children.length; i < l; i++) {
- this.children[i].fill({ color: 'pink' })
- }
-
- return this
+ this.each(function() {
+ this.fill('pink')
+ })
}
})
```
@@ -2417,7 +2416,7 @@ You can also extend multiple elements at once:
```javascript
SVG.extend(SVG.Ellipse, SVG.Path, SVG.Polygon, {
paintRed: function() {
- return this.fill({ color: 'orangered' })
+ return this.fill('orangered')
}
})