MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DrawInset

Function DrawInset

src/widget.cpp:445–449  ·  view source on GitHub ↗

* Draw an inset widget. * @param r Rectangle of the background. * @param colour Colour of the inset. * @param text_colour Colour of the text. * @param str Text to draw. * @param align Alignment of the text. * @param fs Font size of the text. */

Source from the content-addressed store, hash-verified

443 * @param fs Font size of the text.
444 */
445static inline void DrawInset(const Rect &r, Colours colour, TextColour text_colour, std::string_view str, StringAlignment align, FontSize fs)
446{
447 DrawFrameRect(r, colour, {FrameFlag::Lowered, FrameFlag::Darkened});
448 if (!str.empty()) DrawString(r.Shrink(WidgetDimensions::scaled.inset), str, text_colour, align, false, fs);
449}
450
451/**
452 * Draw a matrix widget.

Callers 1

DrawMethod · 0.85

Calls 4

ShrinkMethod · 0.80
DrawFrameRectFunction · 0.70
DrawStringFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected