Skip to content

Commit

Permalink
fix(background): Use transparent background on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
computerjazz authored and st0ffern committed Sep 1, 2017
1 parent b26273c commit f853f87
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ImageCrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ImageCrop extends Component {
this._dimensionAfterZoom = imageDimensionsAfterZoom(
{height: this.props.cropHeight, width: this.props.cropWidth},
{height: this.state.imageHeight, width: this.state.imageWidth},
this.state.zoom
this.state.zoom
)

this.setState({
Expand Down Expand Up @@ -117,10 +117,10 @@ class ImageCrop extends Component {
if (newPosY< 0) newPosY = Number(0)

var movement = movementFromZoom(
gestureState,
{width: this.props.cropWidth, height: this.props.cropHeight},
{width: this.state.imageDimWidth, height: this.state.imageDimHeight},
{x: this.offsetX, y: this.offsetY},
gestureState,
{width: this.props.cropWidth, height: this.props.cropHeight},
{width: this.state.imageDimWidth, height: this.state.imageDimHeight},
{x: this.offsetX, y: this.offsetY},
this.state.zoom
)
this.setState({centerX: movement.x})
Expand All @@ -137,7 +137,7 @@ class ImageCrop extends Component {
let b = evt.nativeEvent.changedTouches[0].locationY - evt.nativeEvent.changedTouches[1].locationY
let c = Math.sqrt( a*a + b*b )
this.zoomCurrentDistance = c.toFixed(1)

//what is the zoom level
var screenDiagonal = Math.sqrt(this.state.imageHeight*this.state.imageHeight + this.state.imageWidth*this.state.imageWidth)
var distance = (this.zoomCurrentDistance-this.zoomLastDistance)/400
Expand Down Expand Up @@ -167,7 +167,7 @@ class ImageCrop extends Component {
this._dimensionAfterZoom = imageDimensionsAfterZoom(
{height: this.props.cropHeight, width: this.props.cropWidth},
{height: this.state.imageHeight, width: this.state.imageWidth},
this.state.zoom
this.state.zoom
)

this.setState({
Expand All @@ -178,7 +178,7 @@ class ImageCrop extends Component {
render() {
return (
<View {...this._panResponder.panHandlers}>
<Surface width={this.props.cropWidth} height={this.props.cropHeight} pixelRatio={this.props.pixelRatio} ref="cropit">
<Surface width={this.props.cropWidth} height={this.props.cropHeight} pixelRatio={this.props.pixelRatio} backgroundColor="transparent" ref="cropit">
<GLImage
source={{ uri: this.props.image}}
imageSize={{height: this.state.imageHeight, width: this.state.imageWidth}}
Expand Down Expand Up @@ -218,4 +218,4 @@ ImageCrop.propTypes = {
type: React.PropTypes.string,
format: React.PropTypes.string,
}
module.exports=ImageCrop
module.exports=ImageCrop

0 comments on commit f853f87

Please sign in to comment.