| 12 | } |
| 13 | |
| 14 | void 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 | |
| 27 | void ExtendedTextBox::OnMouseDown(vector2i_t mousePos){ |
| 28 | if((mousePos.x - fixedBounds.pos.x) > LINE_NUM_PANEL_WIDTH){ |
no test coverage detected