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

Method Paint

Applications/TextEdit/exttextbox.cpp:14–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void ExtendedTextBox::Paint(surface_t* surface){
15 char num[10];
16 for(int i = floor(((double)sBar.scrollPos) / (font->height + lineSpacing)); i < static_cast<int>(contents.size()); i++){
17 int yPos = fixedBounds.y + i * (lineSpacing + font->height) - sBar.scrollPos;
18 sprintf(num, "%d", i);
19 int textSz = Lemon::Graphics::GetTextLength(num);
20 Lemon::Graphics::DrawString(num, fixedBounds.pos.x + (LINE_NUM_PANEL_WIDTH / 2) - textSz / 2, yPos + lineSpacing / 2, Lemon::colours[Lemon::Colour::Text], surface);
21 }
22 fixedBounds = textBoxBounds;
23 TextBox::Paint(surface);
24 fixedBounds = normalBounds;
25}
26
27void ExtendedTextBox::OnMouseDown(vector2i_t mousePos){
28 if((mousePos.x - fixedBounds.pos.x) > LINE_NUM_PANEL_WIDTH){

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls 5

floorFunction · 0.85
GetTextLengthFunction · 0.85
PaintFunction · 0.85
sizeMethod · 0.80
DrawStringFunction · 0.50

Tested by

no test coverage detected