MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / ScrollUp

Method ScrollUp

Goldleaf/source/ui/ui_FileContentLayout.cpp:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 }
57
58 bool FileContentLayout::ScrollUp() {
59 if(this->line_offset > 0) {
60 if(this->read_lines.size() >= this->available_line_count) {
61 this->read_lines.pop_back();
62 }
63 this->line_offset--;
64
65 const auto new_line_l = this->ReadLines(this->line_offset, 1);
66 if(!new_line_l.empty()) {
67 this->read_lines.insert(this->read_lines.begin(), new_line_l.front());
68 }
69
70 this->UpdateLineLimits();
71 return true;
72 }
73 return false;
74 }
75
76 bool FileContentLayout::ScrollDown() {
77 if(!this->read_lines.empty()) {

Callers 1

OnInputMethod · 0.95

Calls 2

ReadLinesMethod · 0.95
UpdateLineLimitsMethod · 0.95

Tested by

no test coverage detected