mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-10-05 16:07:05 +08:00
all: use Go 1.21's min/max builtin functions
This commit is contained in:
@@ -163,19 +163,9 @@ func loadImage(data []byte) (*ebiten.Image, error) {
|
||||
}
|
||||
|
||||
// max returns the largest of x or y.
|
||||
func max(x, y int) int {
|
||||
if x > y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
// maxSide returns the largest side of a or b images.
|
||||
func maxSide(a, b *ebiten.Image) int {
|
||||
return max(
|
||||
max(a.Bounds().Dx(), b.Bounds().Dx()),
|
||||
max(a.Bounds().Dy(), b.Bounds().Dy()),
|
||||
)
|
||||
return max(a.Bounds().Dx(), b.Bounds().Dx(), a.Bounds().Dy(), b.Bounds().Dy())
|
||||
}
|
||||
|
||||
// drawCenteredText is a util function for drawing blend mode description.
|
||||
|
Reference in New Issue
Block a user