Skip to content
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

[macOS] Fix rotation #3122

Merged
merged 1 commit into from
Sep 24, 2024
Merged

[macOS] Fix rotation #3122

merged 1 commit into from
Sep 24, 2024

Conversation

m-bert
Copy link
Contributor

@m-bert m-bert commented Sep 23, 2024

Description

Turns out that rotation on macOS works in opposite direction comparing to other platforms. This PR fixes that behavior.

Test plan

Tested on the following code (check `rotation` value in event)
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';

export default function EmptyExample() {
  const g = Gesture.Rotation().onChange(console.log);
  return (
    <View style={styles.container}>
      <GestureDetector gesture={g}>
        <View style={{ width: 300, height: 300, backgroundColor: 'red' }} />
      </GestureDetector>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});

Copy link
Contributor

@latekvo latekvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on iOS and macOS, they now both function identically 👍

@m-bert m-bert merged commit 214663f into main Sep 24, 2024
3 checks passed
@m-bert m-bert deleted the @mbert/fix-rotation-macos branch September 24, 2024 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants