* Helper function to draw a string (line) in the window. * @param r The (screen) rectangle we must draw within * @param offset The offset (in lines) we want to draw for * @param string The string to draw */
| 374 | * @param string The string to draw |
| 375 | */ |
| 376 | void DrawString(const Rect &r, int offset, const std::string &string) const |
| 377 | { |
| 378 | offset -= this->vscroll->GetPosition(); |
| 379 | if (offset < 0 || offset >= this->vscroll->GetCapacity()) return; |
| 380 | |
| 381 | ::DrawString(r.Shrink(WidgetDimensions::scaled.frametext).Shrink(0, offset * this->resize.step_height, 0, 0), string, TC_BLACK); |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * Helper function to draw the vehicle chain widget. |
no test coverage detected