mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user