* * rct2: 0x006EB6CE */
| 140 | * rct2: 0x006EB6CE |
| 141 | */ |
| 142 | static void WidgetFrameDraw(RenderTarget& rt, WindowBase& w, WidgetIndex widgetIndex) |
| 143 | { |
| 144 | // Get the widget |
| 145 | const auto& widget = w.widgets[widgetIndex]; |
| 146 | |
| 147 | // Resolve the absolute ltrb |
| 148 | auto leftTop = w.windowPos + ScreenCoordsXY{ widget.left, widget.top }; |
| 149 | int32_t r = w.windowPos.x + widget.right; |
| 150 | int32_t b = w.windowPos.y + widget.bottom; |
| 151 | |
| 152 | // |
| 153 | auto brightness |
| 154 | = (w.flags.has(WindowFlag::higherContrastOnPress) ? Rectangle::FillBrightness::dark |
| 155 | : Rectangle::FillBrightness::light); |
| 156 | |
| 157 | auto colour = w.colours[widget.colour]; |
| 158 | |
| 159 | // Draw the frame |
| 160 | Rectangle::fillInset(rt, { leftTop, { r, b } }, colour, Rectangle::BorderStyle::outset, brightness); |
| 161 | |
| 162 | if (!w.canBeResized()) |
| 163 | return; |
| 164 | |
| 165 | // Draw the resize sprite at the bottom right corner |
| 166 | leftTop = w.windowPos + ScreenCoordsXY{ widget.right - 18, widget.bottom - 18 }; |
| 167 | GfxDrawSprite(rt, ImageId(SPR_RESIZE, colour.colour), leftTop); |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * |
no test coverage detected