Fixed empty cells in Grid not handled correctly.
This commit is contained in:
parent
53c57267b1
commit
76c518b3e2
2
grid.go
2
grid.go
|
@ -288,6 +288,7 @@ func (g *grid) allocate(x int, y int, width int, height int, d *sizing) (allocat
|
||||||
for row, xcol := range g.grid {
|
for row, xcol := range g.grid {
|
||||||
current = nil
|
current = nil
|
||||||
for col, c := range xcol {
|
for col, c := range xcol {
|
||||||
|
if c != nil { // treat empty cells like spaces
|
||||||
cell := g.controls[c]
|
cell := g.controls[c]
|
||||||
as := c.allocate(x + cell.xoff, y + cell.yoff, cell.width, cell.height, d)
|
as := c.allocate(x + cell.xoff, y + cell.yoff, cell.width, cell.height, d)
|
||||||
if current != nil { // connect first left to first right
|
if current != nil { // connect first left to first right
|
||||||
|
@ -299,6 +300,7 @@ func (g *grid) allocate(x int, y int, width int, height int, d *sizing) (allocat
|
||||||
current = nil // spaces don't have allocation data
|
current = nil // spaces don't have allocation data
|
||||||
}
|
}
|
||||||
allocations = append(allocations, as...)
|
allocations = append(allocations, as...)
|
||||||
|
}
|
||||||
x += colwidths[col] + d.xpadding
|
x += colwidths[col] + d.xpadding
|
||||||
}
|
}
|
||||||
x = startx
|
x = startx
|
||||||
|
|
Loading…
Reference in New Issue