changing Height() to reflect more realistic values

This commit is contained in:
Jeff Carr 2025-02-08 14:04:11 -06:00
parent 5827b9ace2
commit 23dfd96a87
2 changed files with 13 additions and 2 deletions

View File

@ -258,9 +258,7 @@ func (tk *guiWidget) setFullSize() bool {
tk.full.h1 = tk.full.h0 + 1
}
if tk.isWindowDense() && tk.isInGrid() {
// if tk.full.Height() > 0 {
tk.full.h1 = tk.full.h0
// }
}
if changed {
tk.dumpWidget(fmt.Sprintf("setFullSize(changed)"))

View File

@ -130,6 +130,19 @@ func (r *rectType) Width() int {
}
func (r *rectType) Height() int {
if r.h0 == 0 && r.h1 == 0 {
// edge case. only return 0 for these
return 0
}
if r.h1 == r.h0 {
// if they are equal, it's actually height = 1
return 1
}
if r.h1-r.h0 < 1 {
// can't have negatives. something is wrong. return 1 for now
return 1
}
return r.h1 - r.h0
}