ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
theme.cpp
Go to the documentation of this file.
2
4
6{
7 if (style.width <= 0.0F || style.color.a == 0) {
8 return;
9 }
10
11 // Outline drawn inside the quad, so grow it by the gap and the width
12 const float grow = style.offset + style.width;
13 const asw::Quad<float> outer { { bounds.position.x - grow, bounds.position.y - grow },
14 { bounds.size.x + (grow * 2.0F), bounds.size.y + (grow * 2.0F) } };
15 asw::draw::rect(outer, style.color, style.width);
16}
A 2D rectangle in space.
Definition geometry.h:504
Routines for drawing sprites and primitives to the screen.
void rect(const asw::Quad< float > &position, asw::Color color, float thickness=1.0F)
Draw a rectangle.
Definition draw.cpp:504
void draw_focus_ring(const FocusRingStyle &style, const asw::Quad< float > &bounds)
Draw a focus ring around a widget.
Definition theme.cpp:5
uint8_t a
Definition color.h:33
asw::Color color
Ring color.
Definition theme.h:239
float width
Ring width in pixels. 0 draws no ring.
Definition theme.h:242
float offset
Gap between the widget and the ring, in pixels.
Definition theme.h:245
UI theme configuration for the ASW UI module.