diff options
| author | Pietro Gagliardi <[email protected]> | 2014-09-03 18:26:49 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-09-03 18:26:49 -0400 |
| commit | 986c75493d37e2031e837108c4461e8afac65221 (patch) | |
| tree | baaae19bf3e93f2550bccb7592885e21057762c9 | |
| parent | fcd55f7636031414a874a81c304da23aa83238e2 (diff) | |
Fixed errors preventing current test program from rendering new Grids correctly.
| -rw-r--r-- | grid.go | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -218,27 +218,29 @@ func (g *grid) allocate(x int, y int, width int, height int, d *sizing) (allocat // 2) figure out which columns expand // we only mark the first row/column of a spanning cell as expanding to prevent unexpected behavior - nxexpand := 0 - nyexpand := 0 for i := range g.controls { if g.controls[i].xexpand { xexpand[g.controls[i].x] = true - nxexpand++ } if g.controls[i].yexpand { yexpand[g.controls[i].y] = true - nyexpand++ } } - // 3) assign expanded widths/heights + // 3) compute and assign expanded widths/heights + nxexpand := 0 + nyexpand := 0 for x, expand := range xexpand { - if !expand { + if expand { + nxexpand++ + } else { width -= colwidths[x] } } for y, expand := range yexpand { - if !expand { + if expand { + nyexpand++ + } else { height -= rowheights[y] } } |
