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

Limiting the y and x axis #36

Open
Ahmed-Imam opened this issue Dec 29, 2018 · 2 comments
Open

Limiting the y and x axis #36

Ahmed-Imam opened this issue Dec 29, 2018 · 2 comments

Comments

@Ahmed-Imam
Copy link

I want to limit the draggable components to be dragged in the above part of the screen only

<Gestures
               rotatable={false}
                draggable={{
                       y: height/2,
                                 }}
                  scalable={{
                          min: 0.1,
                           max: 7,
                               }}/>
@stokesbga
Copy link

Check out my fork. still updating it, but it has a callback for onOutOfBounds and props for containerStyle etc.

@Ahmed-Imam
Copy link
Author

Ahmed-Imam commented Feb 21, 2019

I solved the issue temporary as follow, please share if you have a better solution or any suggestion

<Gestures
    onChange={(event) => event.touchHistory.touchBank[Platform.OS == 'ios' ? 1 : 0].currentPageY >= 300 ?
     this.setState({ Y: false }) : this.setState({ Y: true })}
     draggable={{
            y: this.state.Y,
            x: true}}>
          <Text>Test</Text>
</Gestures>

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

No branches or pull requests

2 participants