summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-07-31 20:31:07 +0200
committerwout <wout@impinc.co.uk>2014-07-31 20:31:07 +0200
commit98b3ec9d79ef31d59dc865fbc15919b44c69b576 (patch)
treee1bf9c0c6293a5122f5da9443dec7ee82ed7c4d0 /README.md
parentb2ab34637b96f7bab941390f71b7aafd46ec5565 (diff)
downloadsvg.js-98b3ec9d79ef31d59dc865fbc15919b44c69b576.tar.gz
svg.js-98b3ec9d79ef31d59dc865fbc15919b44c69b576.zip
Reworked sub-pixel offset fix
Diffstat (limited to 'README.md')
-rwxr-xr-xREADME.md15
1 files changed, 12 insertions, 3 deletions
diff --git a/README.md b/README.md
index e2519c4..5b7a63f 100755
--- a/README.md
+++ b/README.md
@@ -67,11 +67,17 @@ Svg.js also works outside of the HTML DOM, inside an SVG document for example:
</svg>
```
-### Sub pixel offset fix
-By default sub pixel offset won't be corrected. To enable it, call the `fixSubPixelOffset()` method:
+### Sub-pixel offset fix
+Call the `spof()` method to fix sub-pixel offset:
```javascript
-var draw = SVG('drawing').fixSubPixelOffset()
+var draw = SVG('drawing').spof()
+```
+
+To enable automatic sub-pixel offset correction when the window is resized:
+
+```javascript
+SVG.on(window, 'resize', function() { draw.spof() })
```
## Parent elements
@@ -3642,6 +3648,9 @@ SVG.extend(SVG.Rect, {
})
```
+### Refactor your code
+Once your implementation is ready, revisit and rework it. We like to keep it [DRY](http://en.wikipedia.org/wiki/Don't_repeat_yourself).
+
### Test. Your. Code.
It's not that hard to write at least one example per implementation, although we prefer more. Your code might seem to work by quickly testing it in your brwoser but more than often you can't forsee everything.