ui: get rid of Inf

It's not worth the special cases. Use a large value where needed
(layout.List, text.Editor...) instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-29 12:12:51 +02:00
parent 1b684ffab6
commit 5f2adf9b2f
10 changed files with 33 additions and 81 deletions
+2 -16
View File
@@ -606,25 +606,11 @@ func boundRectF(r f32.Rectangle) image.Rectangle {
}
func ceil(v float32) int {
switch {
case math.IsInf(float64(v), +1):
return ui.Inf
case math.IsInf(float64(v), -1):
return -ui.Inf
default:
return int(math.Ceil(float64(v)))
}
return int(math.Ceil(float64(v)))
}
func floor(v float32) int {
switch {
case math.IsInf(float64(v), +1):
return ui.Inf
case math.IsInf(float64(v), -1):
return -ui.Inf
default:
return int(math.Floor(float64(v)))
}
return int(math.Floor(float64(v)))
}
func (d *drawOps) reset(cache *resourceCache, viewport image.Point) {