Codechange: Make a generic DrawRectOutline function from DrawOutline. (#11524)

This allows drawing an outline from Rect, not just constrained to a Widget's Rect. And reduces duplication a little.
This commit is contained in:
Peter Nelson
2023-11-30 18:10:07 +00:00
committed by GitHub
parent 33ba609290
commit 6f7153bf71
4 changed files with 19 additions and 10 deletions

View File

@@ -103,6 +103,7 @@ void GfxFillRect(int left, int top, int right, int bottom, int colour, FillRectM
void GfxFillPolygon(const std::vector<Point> &shape, int colour, FillRectMode mode = FILLRECT_OPAQUE);
void GfxDrawLine(int left, int top, int right, int bottom, int colour, int width = 1, int dash = 0);
void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3);
void DrawRectOutline(const Rect &r, int colour, int width = 1, int dash = 0);
/* Versions of DrawString/DrawStringMultiLine that accept a Rect instead of separate left, right, top and bottom parameters. */
static inline int DrawString(const Rect &r, std::string_view str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL)