react-parallax-tilt
react-parallax-tilt copied to clipboard
Incorrect center of rotation when inside scaled component
Description
When the <Tilt> component is a child of some component <Comp> where scale is set to some value other than 1, the center of rotation for the Tilt effect moves to a off center position.
Link to Reproduction - Please provide demo in online code editor CodeSandbox or similar. - Issues without a reproduction link are likely to stall.
https://mkosir.github.io/react-parallax-tilt/?path=/story/react-parallax-tilt--event-params
Steps to reproduce
- Go to 'https://mkosir.github.io/react-parallax-tilt/?path=/story/react-parallax-tilt--event-params'
- 'Inspect' the demo object, and apply custom property 'scale: 2' on the
<divclass="event-params"> ` html tag. - Hover the center of the scaled demo object.
- See how it is tilted at an incorrect angle.
Expected behavior
When scaled, the center of rotation should scale correctly too
Code snippets
No response
React Parallax Tilt Version
1.7.172
Browser
Google Chrome 119.0.6045.199
Operating System
- [X] macOS
- [X] Windows
- [ ] Linux
Additional Information
No response