-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Shadow in SVG is displaying in wrong location when the object is rotated #2669
Comments
Omg, i never noticed this. In the canvas the shadow is managed like a shadow, while in svg we emulate it with a filter that makes a copy of the shadow displaced. |
Not a simple fix. i tried couple of hours thinking that rotating shadow offset would help me, but is not that easy. Rotation repeats every 90 degrees and i cannot guess easily the algorithm behind canvas shadow. |
I think this should fix it, calculating the rotation modifying the area for the filter to accounted for the rotation. |
Yes it does. ( when angle was not working i then lost myself in terrible calculation searching for some complicated solution including angle of shadow itself and so on...) |
i will make a pr later, so we merge this. |
thanks @asturur |
no it is totally right, i m stupid. if i rotate the object of x, i have to rotate back the shadow of -x to leave it in its original position. that's all :) |
closed with latests commit |
the SVG generated from shadow for the rotated object is not in the same position as the in canvas. I am assuming that the x and y position of the shadow does not accounted for the angle in the object's shadow.
http://jsfiddle.net/1fgk6qoo/
The text was updated successfully, but these errors were encountered: