added outside glow

This commit is contained in:
2026-07-11 22:39:18 +03:00
parent 1618a41318
commit cbe220664f
7 changed files with 98 additions and 23 deletions
@@ -39,9 +39,19 @@ namespace omath::hud::widget
float intensity = 1.f;
};
enum class CanvasGlowMode
{
INSIDE,
OUTSIDE,
BOTH,
};
struct CanvasGlow
{
Glow glow;
int layers = 64;
CanvasGlowMode mode = CanvasGlowMode::INSIDE;
float rounding = 20.f;
};
// ── Standalone widgets ────────────────────────────────────────────────────
@@ -38,6 +38,12 @@ namespace omath::hud
virtual void add_filled_circle(const Vector2<float>& center, float radius, const Color& color,
int segments = 0) = 0;
virtual void add_filled_ellipse(const Vector2<float>& center, const Vector2<float>& radius, const Color& color,
int segments = 0)
{
add_filled_circle(center, std::min(radius.x, radius.y), color, segments);
}
/// Draw an arc (partial circle outline). Angles in radians, 0 = right (+X), counter-clockwise.
virtual void add_arc(const Vector2<float>& center, float radius, float a_min, float a_max, const Color& color,
float thickness, int segments = 0) = 0;
@@ -24,6 +24,8 @@ namespace omath::hud
int segments = 0) override;
void add_filled_circle(const Vector2<float>& center, float radius, const Color& color,
int segments = 0) override;
void add_filled_ellipse(const Vector2<float>& center, const Vector2<float>& radius, const Color& color,
int segments = 0) override;
void add_arc(const Vector2<float>& center, float radius, float a_min, float a_max, const Color& color,
float thickness, int segments = 0) override;
void add_image(const std::any& texture_id, const Vector2<float>& min, const Vector2<float>& max,