Skip to content

Transform origin center results in transformation relative to the top left corner #2361

Open
@MatiPl01

Description

@MatiPl01

Environment

react-native -v: 0.76.5
npm ls react-native-macos: 0.76.6
node -v: v20.10.0
npm -v: 10.2.3
yarn --version: 1.22.22
xcodebuild -version: Xcode 15.4

Steps to reproduce the bug

  1. Add transform: [{ rotate: '45deg' }] (or similar rotation) to any view style,
  2. Observe that the view rotates around the top-left corner,
  3. Set transformOrigin to bottom right,
  4. Observe that now the view rotates around the center

Expected Behavior

The transformOrigin should be properly placed and rotation should be applied relative to the transformOrigin.

Actual Behavior

The view rotates around wrong origin.

Reproducible Demo

I just added rotation animation with react-native-reanimated to the entire section in the starter app. It should rotate around center.

Screen.Recording.2025-01-24.at.15.04.18.mov

Additional context

Similar issue was reported before: #1891

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions