Added a sanity check for stretchy control indices in the Grid code.
This commit is contained in:
parent
c993c6b8e8
commit
f8bca7e0e0
4
grid.go
4
grid.go
|
@ -159,8 +159,10 @@ func (g *Grid) setRect(x int, y int, width int, height int, rr *[]resizerequest)
|
||||||
}
|
}
|
||||||
g.colwidths[g.stretchycol] = width
|
g.colwidths[g.stretchycol] = width
|
||||||
g.rowheights[g.stretchyrow] = height
|
g.rowheights[g.stretchyrow] = height
|
||||||
|
} else if (g.stretchyrow == -1 && g.stretchycol != -1) || // sanity check
|
||||||
|
(g.stretchyrow != -1 && g.stretchycol == -1) {
|
||||||
|
panic(fmt.Errorf("internal inconsistency in Grid: stretchy (%d,%d) impossible (one component, not both, is -1/no stretchy control)", g.stretchyrow, g.stretchycol))
|
||||||
}
|
}
|
||||||
// TODO add a sanity check for g.stretchyrow xor g.stretchycol == -1?
|
|
||||||
// 4) draw
|
// 4) draw
|
||||||
startx := x
|
startx := x
|
||||||
for row, xcol := range g.controls {
|
for row, xcol := range g.controls {
|
||||||
|
|
Loading…
Reference in New Issue