diff options
Diffstat (limited to 'src/matrix.js')
-rw-r--r-- | src/matrix.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/matrix.js b/src/matrix.js index c040b7a..60f3531 100644 --- a/src/matrix.js +++ b/src/matrix.js @@ -182,6 +182,16 @@ SVG.Matrix = SVG.invent({ }, // Get current screen matrix screenCTM: function() { + /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537 + This is needed because FF does not return the transformation matrix + for the inner coordinate system when getScreenCTM() is called on nested svgs. + However all other Browsers do that */ + if(this instanceof SVG.Nested) { + var rect = this.rect(1,1) + var m = rect.node.getScreenCTM() + rect.remove() + return new SVG.Matrix(m) + } return new SVG.Matrix(this.node.getScreenCTM()) } |