mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add offset sanity check to CompactGrid Align()
This commit is contained in:
parent
0a05007c4e
commit
b88c143914
@ -22,9 +22,14 @@ func NewCompactGrid() *CompactGrid {
|
||||
|
||||
func (cg *CompactGrid) Align() {
|
||||
y := cg.Y
|
||||
|
||||
if cg.Offset >= len(cg.Rows) {
|
||||
cg.Offset = 0
|
||||
}
|
||||
if cg.Offset < 0 {
|
||||
cg.Offset = 0
|
||||
}
|
||||
|
||||
// update row ypos, width recursively
|
||||
for _, r := range cg.pageRows() {
|
||||
r.SetY(y)
|
||||
|
Loading…
Reference in New Issue
Block a user