mirror of https://github.com/rivo/tview.git
Minor code reduction.
This commit is contained in:
parent
8cb36ea743
commit
ccd80aa4fc
3
table.go
3
table.go
|
@ -618,11 +618,10 @@ ColumnLoop:
|
||||||
// If we have space left, distribute it.
|
// If we have space left, distribute it.
|
||||||
if tableWidth < width {
|
if tableWidth < width {
|
||||||
toDistribute := width - tableWidth
|
toDistribute := width - tableWidth
|
||||||
for index := range widths {
|
for index, expansion := range expansions {
|
||||||
if expansionTotal <= 0 {
|
if expansionTotal <= 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
expansion := expansions[index]
|
|
||||||
expWidth := toDistribute * expansion / expansionTotal
|
expWidth := toDistribute * expansion / expansionTotal
|
||||||
widths[index] += expWidth
|
widths[index] += expWidth
|
||||||
tableWidth += expWidth
|
tableWidth += expWidth
|
||||||
|
|
Loading…
Reference in New Issue