calcMaxFirst calculates the maximum index of the first visible row such as the remaining rows fits completely inside the table It is used when scrolling the table vertically
()
| 1504 | // such as the remaining rows fits completely inside the table |
| 1505 | // It is used when scrolling the table vertically |
| 1506 | func (t *Table) calcMaxFirst() int { |
| 1507 | |
| 1508 | _, total := t.rowsHeight() |
| 1509 | ri := len(t.rows) - 1 |
| 1510 | if ri < 0 { |
| 1511 | return 0 |
| 1512 | } |
| 1513 | height := float32(0) |
| 1514 | for { |
| 1515 | trow := t.rows[ri] |
| 1516 | height += trow.height |
| 1517 | if height > total { |
| 1518 | break |
| 1519 | } |
| 1520 | ri-- |
| 1521 | if ri < 0 { |
| 1522 | break |
| 1523 | } |
| 1524 | } |
| 1525 | return ri + 1 |
| 1526 | } |
| 1527 | |
| 1528 | // updateRowStyle applies the correct style for the specified row |
| 1529 | func (t *Table) updateRowStyle(ri int) { |
no test coverage detected