Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix for WebKit bad CTM when zoom != 1 #766
A good place to test to see the diff is the mouse example.
I refactored your code a little bit so that there is a d3_mouse_getScreenCTM function that just returns the 'fixed' CTM.
I added some extra code to set the html and body position to 'static' before doing the bug test. This is so that the test is more robust - an insane person might have body or html not be at (0,0) and have position not static.
d3.select('body') .style('position', 'absolute') .style('left', 0) .style('top', '10px'); window.scrollTo(0, 10);
Add this to your code and it would trick the regular d3.mouse function to think that bug44083 exists when it might not.
referenced this pull request
Aug 14, 2012
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
Also if you want to try out this but you can not be bothered to get my forked d3 then simply import https://github.com/vogievetsky/KoalasToTheMax/blob/master/d3.mouse.patch.js into your project it is the same code and it will override the regular d3.mouse function with the fixed one. Note that that file might disappear if this pull request goes into d3 (So don't hotlink).