Fix grid offset bug mentioned in https://github.com/gizak/termui/issues/26
This commit is contained in:
parent
b0a574c387
commit
ce9fe5f9c4
6
grid.go
6
grid.go
@ -85,11 +85,11 @@ func (r *row) assignX(x int) {
|
||||
if !r.isLeaf() {
|
||||
acc := 0
|
||||
for i, c := range r.Cols {
|
||||
if c.Offset != 0 {
|
||||
acc += int(float64(c.Offset*r.Width) / float64(12))
|
||||
}
|
||||
r.Cols[i].assignX(x + acc)
|
||||
acc += c.Width
|
||||
if c.Offset != 0 {
|
||||
acc += int(float64(c.Offset*c.Width) / float64(12*c.Span))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user