Skip to content

Commit

Permalink
Merge pull request #87 from injitools/master
Browse files Browse the repository at this point in the history
Fix image positioning in fit
  • Loading branch information
zhanziyang authored Apr 6, 2018
2 parents 8bd7b16 + 4728eec commit 64b0a6d
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 @@ -888,11 +888,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 64b0a6d

Please sign in to comment.