"vscode:/vscode.git/clone" did not exist on "3fe3bc0642cf6ebfa1a815367afd0dc57675ecc7"
Commit 47298fce authored by shengxinjing's avatar shengxinjing Committed by Michael Yang
Browse files

refactor: use builtin max and min

parent 4a48937e
...@@ -124,7 +124,7 @@ func (p ImageProcessor) maxResolution(imageRes, targetRes image.Point) image.Poi ...@@ -124,7 +124,7 @@ func (p ImageProcessor) maxResolution(imageRes, targetRes image.Point) image.Poi
if scaleW < scaleH { if scaleW < scaleH {
newRes = image.Point{ newRes = image.Point{
targetRes.X, targetRes.X,
int(math.Floor(float64(imageRes.Y)*scaleW), float64(targetRes.Y))), int(min(math.Floor(float64(imageRes.Y)*scaleW), float64(targetRes.Y))),
} }
} else { } else {
newRes = image.Point{ newRes = image.Point{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment