Skip to content

Commit

Permalink
Fix initial zoom bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Aug 2, 2017
1 parent fe512fd commit 0286656
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/esper/esper.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,24 @@ class Esper extends PureComponent {
mirror: false,
width: 0,
height: 0,
aspect: 0,
src: null
}
}

getStateFromProps(props) {
const state = this.getEmptyState()
const state = this.getEmptyState(props)
const { photo } = props

if (photo != null && !photo.pending) {
state.src = `${photo.protocol}://${photo.path}`

assign(state, this.getOrientationState(photo))
assign(state, this.getAngleBounds(photo))
assign(state, this.getAngleBounds({
angle: state.angle,
width: photo.width,
height: photo.height
}))
}

assign(state, this.getZoomBounds(this.view.bounds, state, props))
Expand Down

0 comments on commit 0286656

Please sign in to comment.