1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00

Go <1.10 doesn't have math.Round, ook

This commit is contained in:
DarthSim 2018-09-11 18:24:16 +06:00
parent 0eb96b0b42
commit 27c1ef068a

View File

@ -201,8 +201,8 @@ func calcCrop(width, height int, po processingOptions) (left, top int) {
}
if po.Gravity.Type == gravityFocusPoint {
pointX := int(math.Round(float64(width) * po.Gravity.X))
pointY := int(math.Round(float64(height) * po.Gravity.Y))
pointX := int(float64(width) * po.Gravity.X)
pointY := int(float64(height) * po.Gravity.Y)
left = maxInt(0, minInt(pointX-po.Width/2, width-po.Width))
top = maxInt(0, minInt(pointY-po.Height/2, height-po.Height))