mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 09:59:43 +00:00
LibWeb: Don't draw shadows for transparent gradient fills
This commit is contained in:
parent
13f551612c
commit
0516c414d4
Notes:
github-actions[bot]
2025-10-21 16:56:41 +00:00
Author: https://github.com/tcl3
Commit: 0516c414d4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6530
Reviewed-by: https://github.com/gmta ✅
6 changed files with 106 additions and 0 deletions
|
|
@ -1070,6 +1070,9 @@ void CanvasRenderingContext2D::paint_shadow_for_fill_internal(Gfx::Path const& p
|
|||
if (state.current_compositing_and_blending_operator == Gfx::CompositingAndBlendingOperator::Copy)
|
||||
return;
|
||||
|
||||
if (!state.fill_style.to_gfx_paint_style()->is_visible())
|
||||
return;
|
||||
|
||||
auto alpha = state.global_alpha * (state.shadow_color.alpha() / 255.0f);
|
||||
auto fill_style_color = state.fill_style.as_color();
|
||||
if (fill_style_color.has_value() && fill_style_color->alpha() > 0)
|
||||
|
|
@ -1103,6 +1106,9 @@ void CanvasRenderingContext2D::paint_shadow_for_stroke_internal(Gfx::Path const&
|
|||
if (state.shadow_blur == 0.0f && state.shadow_offset_x == 0.0f && state.shadow_offset_y == 0.0f)
|
||||
return;
|
||||
|
||||
if (!state.stroke_style.to_gfx_paint_style()->is_visible())
|
||||
return;
|
||||
|
||||
auto alpha = state.global_alpha * (state.shadow_color.alpha() / 255.0f);
|
||||
auto fill_style_color = state.fill_style.as_color();
|
||||
if (fill_style_color.has_value() && fill_style_color->alpha() > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue