aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.js
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 /src/doc.js
parentb2ab34637b96f7bab941390f71b7aafd46ec5565 (diff)
downloadsvg.js-98b3ec9d79ef31d59dc865fbc15919b44c69b576.tar.gz
svg.js-98b3ec9d79ef31d59dc865fbc15919b44c69b576.zip
Reworked sub-pixel offset fix
Diffstat (limited to 'src/doc.js')
-rwxr-xr-xsrc/doc.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/doc.js b/src/doc.js
index 1e19ec7..c7302aa 100755
--- a/src/doc.js
+++ b/src/doc.js
@@ -53,6 +53,18 @@ SVG.Doc = SVG.invent({
, parent: function() {
return this.node.parentNode.nodeName == '#document' ? null : this.node.parentNode
}
+ // Fix for possible sub-pixel offset. See:
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=608812
+ , spof: function(spof) {
+ var pos = this.node.getScreenCTM()
+
+ if (pos)
+ this
+ .style('left', (-pos.e % 1) + 'px')
+ .style('top', (-pos.f % 1) + 'px')
+
+ return this
+ }
}
})