Fix transparent text shadow rendering

This commit is contained in:
Nikita Lisitsa 2022-05-24 09:47:30 +03:00
parent 1f0854fff6
commit 91fcdfcb29

View file

@ -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});
}
}