react-parallax-tilt icon indicating copy to clipboard operation
react-parallax-tilt copied to clipboard

Incorrect center of rotation when inside scaled component

Open eirikolberg opened this issue 1 year ago • 1 comments

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

  1. Go to 'https://mkosir.github.io/react-parallax-tilt/?path=/story/react-parallax-tilt--event-params'
  2. 'Inspect' the demo object, and apply custom property 'scale: 2' on the <div class="event-params"> ` html tag.
  3. Hover the center of the scaled demo object.
  4. 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

eirikolberg avatar Nov 29 '23 09:11 eirikolberg