* Draw the label-part of a widget. * @param r Rectangle of the label 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. */
| 408 | * @param fs Font size of the text. |
| 409 | */ |
| 410 | static inline void DrawLabel(const Rect &r, TextColour colour, std::string_view str, StringAlignment align, FontSize fs) |
| 411 | { |
| 412 | if (str.empty()) return; |
| 413 | |
| 414 | Dimension d = GetStringBoundingBox(str, fs); |
| 415 | Point p = GetAlignedPosition(r, d, align); |
| 416 | DrawString(r.left, r.right, p.y, str, colour, align, false, fs); |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * Draw text. |
no test coverage detected