* * rct2: 0x006EB8E5 */
| 199 | * rct2: 0x006EB8E5 |
| 200 | */ |
| 201 | static void WidgetButtonDraw(RenderTarget& rt, WindowBase& w, WidgetIndex widgetIndex) |
| 202 | { |
| 203 | // Get the widget |
| 204 | const auto& widget = w.widgets[widgetIndex]; |
| 205 | |
| 206 | // Resolve the absolute ltrb |
| 207 | ScreenRect rect{ w.windowPos + ScreenCoordsXY{ widget.left, widget.top }, |
| 208 | w.windowPos + ScreenCoordsXY{ widget.right, widget.bottom } }; |
| 209 | |
| 210 | // Check if the button is pressed down |
| 211 | auto borderStyle = widgetIsPressed(w, widgetIndex) || isToolActive(w, widgetIndex) ? Rectangle::BorderStyle::inset |
| 212 | : Rectangle::BorderStyle::outset; |
| 213 | |
| 214 | auto colour = w.colours[widget.colour]; |
| 215 | |
| 216 | // Dead code? |
| 217 | if (static_cast<int32_t>(widget.image.GetIndex()) == -2) |
| 218 | { |
| 219 | // Draw border with no fill |
| 220 | Rectangle::fillInset(rt, rect, colour, borderStyle, Rectangle::FillBrightness::light, Rectangle::FillMode::none); |
| 221 | return; |
| 222 | } |
| 223 | |
| 224 | // Draw the border with fill |
| 225 | Rectangle::fillInset(rt, rect, colour, borderStyle); |
| 226 | |
| 227 | WidgetDrawImage(rt, w, widgetIndex); |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * |
no test coverage detected