| 608 | } |
| 609 | |
| 610 | void TextEdit::MoveVerticalScroll() |
| 611 | { |
| 612 | double total_height = GetTotalLineHeight(); |
| 613 | double height_per_line = std::max(1.0, total_height / std::max((size_t)1, lines.size())); |
| 614 | int lines_fit = (int)(GetHeight() / height_per_line); |
| 615 | if (cursor_pos.y >= vert_scrollbar->GetPosition() + lines_fit) |
| 616 | { |
| 617 | vert_scrollbar->SetPosition(cursor_pos.y - lines_fit + 1); |
| 618 | } |
| 619 | else if (cursor_pos.y < vert_scrollbar->GetPosition()) |
| 620 | { |
| 621 | vert_scrollbar->SetPosition(cursor_pos.y); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | double TextEdit::GetTotalLineHeight() |
| 626 | { |
nothing calls this directly
no test coverage detected