From 91fcdfcb29705ee040797da20df4ed77308a13d3 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 24 May 2022 09:47:30 +0300 Subject: [PATCH] Fix transparent text shadow rendering --- libs/ui/source/label.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ui/source/label.cpp b/libs/ui/source/label.cpp index b9f7ada4..4b18be1f 100644 --- a/libs/ui/source/label.cpp +++ b/libs/ui/source/label.cpp @@ -286,9 +286,10 @@ namespace psemek::ui for (auto const & batch : cached_state_->batches) { if (!batch.text) continue; - if (batch.color[3] < 255) continue; + auto color = *st->shadow_color; + color[3] = (color[3] * 1.f * batch.color[3]) / 255.f; for (auto const & image : batch.images) - p.draw_image(image.position + offset, gfx::texture_view_2d{batch.texture, image.texcoords}, {*st->shadow_color, painter::color_mode::multiply}); + p.draw_image(image.position + offset, gfx::texture_view_2d{batch.texture, image.texcoords}, {color, painter::color_mode::multiply}); } }