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

How do you prevent vertical resizing? #9

Open
jake-chambers opened this issue Feb 2, 2021 · 3 comments
Open

How do you prevent vertical resizing? #9

jake-chambers opened this issue Feb 2, 2021 · 3 comments

Comments

@jake-chambers
Copy link

I only want to be able to drag the right and left sides of the view

@surafelbm
Copy link

@jake-chambers have you tried hiding the vertical connectors? You can pass a prop as to which connectors you want displayed.

@Nitingadhiya
Copy link

Issue:- During resize maintain image aspect ratio...

@surafelbm I want maintain image aspect ratio, so how we can mange? I've already tried to hide below connector But it's still not working as per aspected

Hidden :- ['tm', 'mr', 'bm', 'ml']
Show:- ['tl', 'tr', 'br', 'bl', 'c']

See Below Code:-
<DragResizeBlock
x={50}
y={100}
isDisabled={this.state.isDisabled}
onPress={()=> this.setState({isDisabled: false})}
connectors={['tl', 'tr', 'br', 'bl', 'c']}
/>

@ahmadkhudeish
Copy link

ahmadkhudeish commented Aug 6, 2021

@Nitingadhiya try adding resizeMode="stretch" to your draggable image inside DragResizeBlock. This is will make the image stretch to the parent container. There's axis prop which you can set to x-axis. You can set it like that axis="x"

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

4 participants