New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: panning in a by CSS rotated plot doesn't work correctly #1585
Conversation
Is the CI failure related? |
No, I think we need to port #1550 to the 0.12.x branch first |
@mariobuikhuizen can you rebase now that #1550 is in? |
In Firefox and Safari, panning doesn't work correctly when a plots parent is rotated by CSS.
Ah, I can do that from the github UI :) |
Great work mario, GPT4 and Maarten approved :) |
meeseeksdev please backport to master |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…t work correctly (bqplot#1585) In Firefox and Safari, panning doesn't work correctly when a plots parent is rotated by CSS. (cherry picked from commit 02fdfde)
In Firefox and Safari, panning doesn't work correctly when a plot's parent is rotated by CSS.
The panning issue is caused by getScreenCTM() in https://github.com/d3/d3-selection/blob/679346930e41a4037ef72d937b425bbe4d865ab1/src/point.js#L7, which doesn't take the viewport transforms into account in Firefox (https://stackoverflow.com/questions/71368779/svg-getscreenctm-does-not-account-for-css-transforms-in-firefox) and Safari
As seen here: spacetelescope/jdaviz#1384 (comment)
To reproduce, run the following code in Firefox or Safari:
References
Code changes
This commit checks whether the browser is not Chrome and has a rotated parent, then determines the mouse position differently.
User-facing changes
Panning now also works correctly for non-Chrome browsers for plots with CSS rotated parents, with a small difference in behavior: panning stops if the mouse leaves the plot element.