MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / WidgetResizeDraw

Function WidgetResizeDraw

src/openrct2-ui/interface/Widget.cpp:174–195  ·  view source on GitHub ↗

* * rct2: 0x006EB765 */

Source from the content-addressed store, hash-verified

172 * rct2: 0x006EB765
173 */
174 static void WidgetResizeDraw(RenderTarget& rt, WindowBase& w, WidgetIndex widgetIndex)
175 {
176 // Get the widget
177 const auto& widget = w.widgets[widgetIndex];
178
179 // Resolve the absolute ltrb
180 auto leftTop = w.windowPos + ScreenCoordsXY{ widget.left, widget.top };
181 int32_t r = w.windowPos.x + widget.right;
182 int32_t b = w.windowPos.y + widget.bottom;
183
184 auto colour = w.colours[widget.colour];
185
186 // Draw the panel
187 Rectangle::fillInset(rt, { leftTop, { r, b } }, colour);
188
189 if (!w.canBeResized())
190 return;
191
192 // Draw the resize sprite at the bottom right corner
193 leftTop = w.windowPos + ScreenCoordsXY{ widget.right - 18, widget.bottom - 18 };
194 GfxDrawSprite(rt, ImageId(SPR_RESIZE, colour.colour), leftTop);
195 }
196
197 /**
198 *

Callers 1

widgetDrawFunction · 0.85

Calls 4

fillInsetFunction · 0.85
GfxDrawSpriteFunction · 0.85
canBeResizedMethod · 0.80
ImageIdClass · 0.70

Tested by

no test coverage detected