diff --git a/src/ui/material/draw_helpers.h b/src/ui/material/draw_helpers.h index dede7ee..5306d20 100644 --- a/src/ui/material/draw_helpers.h +++ b/src/ui/material/draw_helpers.h @@ -561,22 +561,22 @@ inline bool CardDropShadowWanted() return s_want; } -// Soft drop shadow OUTSIDE a rounded rect, offset down. Drawn as fading rounded-rect STROKES (not -// fills), so it never paints across the card body — only the outer blur remains once the card fill -// covers the interior. This is the "render then mask out the UI area" result without an FBO. +// Soft, UNIFORM shadow around a rounded rect — no directional offset, equal on all sides. Drawn as +// fading rounded-rect STROKES (not fills), so it never paints across the card body — only the outer +// blur remains once the card fill covers the interior. The "render then mask out the UI area" result +// without an FBO. inline void DrawCardDropShadow(ImDrawList* dl, const ImVec2& pMin, const ImVec2& pMax, float rounding) { const float dp = Layout::dpiScale(); - const int kRings = 10; - const float spread = 13.0f * dp; // how far the shadow reaches beyond the card edge - const float offY = 3.0f * dp; // downward drop offset + const int kRings = 12; + const float spread = 14.0f * dp; // how far the shadow reaches beyond the card edge (all sides) for (int i = kRings; i >= 1; --i) { - float t = (float)i / (float)kRings; // 1 (outer) .. 0.1 (near the card) + float t = (float)i / (float)kRings; // 1 (outer) .. near 0 (by the card) float e = spread * t; // expansion at this ring - int a = (int)(20.0f * (1.0f - t) + 0.5f); // alpha: ~0 at the outer edge, strongest by the card + int a = (int)(18.0f * (1.0f - t) + 0.5f); // alpha: ~0 at the outer edge, strongest by the card if (a < 1) continue; - ImVec2 smn(pMin.x - e, pMin.y - e + offY); - ImVec2 smx(pMax.x + e, pMax.y + e + offY); + ImVec2 smn(pMin.x - e, pMin.y - e); + ImVec2 smx(pMax.x + e, pMax.y + e); dl->AddRect(smn, smx, IM_COL32(0, 0, 0, a), rounding + e, 0, 2.0f * dp); } }