-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support Rotation of image with library #41
Comments
Could you perhaps post a small example that is showing the odd behavior that I can experiment with to find a solution? I'm not quite sure I understand what it is you're asking for, but if I can run it and see it for myself that would help. |
I believe what OP means is that when a image is rotated, the calculation which calculates the cursor location is off. This messes up the lens + cursor relationship (I am facing a similar issue). For example, if I rotate a image 180 degrees, the function which calculates the cursor position is now flipped. So if I zoom in on a 180 degree rotated image and move my cursor to the top right, the lens will move to the bottom left instead. I'm not 100% sure, but I believe this issue is related to setZoomPosition(). |
For image rotation I took a vanilla JS approach. Here is the CSS code example:
And another:
|
I believe I have narrowed the issue down to the following chunk of code:
When calculateImageAndLensPosition() is called, the following section will execute if the zoom lens has been enabled:
This will calculate the top and left position of the user's mouse if the zoom lens has been enabled. However, if the image and/or image container has been rotated by any degree, the calculation parameters will not adjust for this change and will inversely calculate the user's mouse position. I have created a temporary fix/hack by implementing the following changes to my own code:
I do not think this is a good long-term solution so I will continue researching other possibilities in the meantime. If you have any recommendations they would be much appreciated! Thanks EDIT: Grammar fixes + code clean up |
Cases:
Problem:
The text was updated successfully, but these errors were encountered: