Skip to content

Commit

Permalink
Fix image positioning in fit
Browse files Browse the repository at this point in the history
  • Loading branch information
injitools authored Apr 6, 2018
1 parent c851ef6 commit 4728eec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cropper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -876,11 +876,13 @@ export default {
this.imgData.height = imgHeight / scaleRatio
this.imgData.width = this.outputWidth
this.imgData.startY = -(this.imgData.height - this.outputHeight) / 2
this.imgData.startX = 0
} else {
scaleRatio = imgHeight / this.outputHeight
this.imgData.width = imgWidth / scaleRatio
this.imgData.height = this.outputHeight
this.imgData.startX = -(this.imgData.width - this.outputWidth) / 2
this.imgData.startY = 0
}
},
Expand Down

0 comments on commit 4728eec

Please sign in to comment.