Michaelvilleneuve / react-native-perspective-image-cropper

Perform custom crop, resizing and perspective correction 📐🖼
MIT License
306 stars 127 forks source link

Add feature pan strict mode #9

Closed Pompette closed 6 years ago

Pompette commented 6 years ago

Add 4 points in the middle of borders to do an horizontal pan or vertical pan. It will move the polygon either on the Y axis or X axis. When adding props enablePanStrict to the component it will enable the new feature.

<CustomCrop
  enablePanStrict
  updateImage={this.updateImage}
  rectangleCoordinates={this.state.rectangleCoordinates}
  initialImage={this.state.initialImage}
  height={this.state.imageHeight}
  width={this.state.imageWidth}
  ref={(ref) => this.customCrop = ref}
  overlayColor="rgba(18,190,210, 1)"
  overlayStrokeColor="rgba(20,190,210, 1)"
  handlerColor="rgba(20,150,160, 1)"
/>

image

Michaelvilleneuve commented 6 years ago

Again, thank you very much for this !