MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Scroll

Function Scroll

Applications/Terminal/main.cpp:89–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87char charactersPerLine;
88
89void Scroll(){
90 if(curPos.y >= rowCount){
91 bufferOffset += curPos.y - (rowCount - 1);
92 curPos.y = rowCount - 1;
93 }
94
95 while(static_cast<std::size_t>(bufferOffset + rowCount) >= buffer.size()) buffer.push_back(std::vector<TerminalChar>());
96
97 if(buffer.size() > 2000){
98 buffer.erase(buffer.begin() + 2000, buffer.end());
99 }
100
101 paintAll = true;
102}
103
104void OnPaint(surface_t* surface){
105 int fontHeight = terminalFont->lineHeight;

Callers 2

DoAnsiCSIFunction · 0.70
PrintCharFunction · 0.70

Calls 3

sizeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected