* Draw text. * @param r Rectangle of the background. * @param colour Colour of the text. * @param str Text to draw. * @param align Alignment of the text. * @param fs Font size of the text. */
| 425 | * @param fs Font size of the text. |
| 426 | */ |
| 427 | static inline void DrawText(const Rect &r, TextColour colour, std::string_view str, StringAlignment align, FontSize fs) |
| 428 | { |
| 429 | if (str.empty()) return; |
| 430 | |
| 431 | Dimension d = GetStringBoundingBox(str, fs); |
| 432 | Point p = GetAlignedPosition(r, d, align); |
| 433 | DrawString(r.left, r.right, p.y, str, colour, align, false, fs); |
| 434 | } |
| 435 | |
| 436 | /** |
| 437 | * Draw an inset widget. |
no test coverage detected