You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
149 B
Go

package ui
4 years ago
type point struct{ x, y int }
func clamp(n, min, max int) int {
if n < min {
return min
}
if n > max {
return max
}
return n
}