react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

TransformOrigin Props not parsed or updated

Open sharath2727 opened this issue 1 year ago • 1 comments

### Problem Description

I can see that while applying transform and transformOrigin props, the transform prop is propagated into the platform but transformOrigin is not being propagated into the platform.

Steps To Reproduce

Use the below tsx file and notice the transformOrigin not taking effect:

import` React from 'react';
import { AppRegistry, View, Animated, StyleSheet } from 'react-native';

export default class Bootstrap extends React.Component {
  render() {
    return (
      <View style={styles.container}>
            <View style={styles.transformOriginWrapper} >
                <Animated.View
                    style={styles.transformOriginView} />
            </View>
      </View>
    );
  }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center', // Center vertically
        alignItems: 'center', // Center horizontally
        backgroundColor: 'white', // Optional: set a background color for the parent container
    },
    transformOriginWrapper: {
        borderWidth: 1
    },
    transformOriginView: {
        backgroundColor: 'gray',
        width: 100,
        height: 100,
        transform: [
            { rotate: '-45deg' }
        ],
        transformOrigin: 'bottom right'
    },
});
AppRegistry.registerComponent('Bootstrap', () => Bootstrap);

Expected Results

Expected: 45 deg transform should happen at bottom right

CLI version

14.0.0-alpha.2

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26252
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  Memory: 14.55 GB / 31.85 GB
Binaries:
  Node:
    version: 18.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.17763.0
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.10.35013.160 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

sharath2727 avatar Jul 16 '24 17:07 sharath2727

Only handling of transformOrigin today seems to be in the JS. Was it not handled in Paper? Or does it get transformed into some other props that come through differently? Needs some investigation of whether this worked before and how it is supposed to propagate from the JS.

https://reactnative.dev/docs/next/transforms

On UWP XAML I would have expected this to set something like this: https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.uielement.rendertransformorigin?view=winrt-26100

chrisglein avatar Jul 22 '24 17:07 chrisglein