mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 18:09:45 +00:00
LibWeb: Don't draw shadows if shadow offset and blur are not set
This commit is contained in:
parent
eb44cca5bd
commit
13f551612c
Notes:
github-actions[bot]
2025-10-21 16:56:48 +00:00
Author: https://github.com/tcl3
Commit: 13f551612c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6530
Reviewed-by: https://github.com/gmta ✅
4 changed files with 48 additions and 6 deletions
|
|
@ -1064,6 +1064,8 @@ void CanvasRenderingContext2D::paint_shadow_for_fill_internal(Gfx::Path const& p
|
|||
return;
|
||||
|
||||
auto& state = this->drawing_state();
|
||||
if (state.shadow_blur == 0.0f && state.shadow_offset_x == 0.0f && state.shadow_offset_y == 0.0f)
|
||||
return;
|
||||
|
||||
if (state.current_compositing_and_blending_operator == Gfx::CompositingAndBlendingOperator::Copy)
|
||||
return;
|
||||
|
|
@ -1098,6 +1100,9 @@ void CanvasRenderingContext2D::paint_shadow_for_stroke_internal(Gfx::Path const&
|
|||
if (state.current_compositing_and_blending_operator == Gfx::CompositingAndBlendingOperator::Copy)
|
||||
return;
|
||||
|
||||
if (state.shadow_blur == 0.0f && state.shadow_offset_x == 0.0f && state.shadow_offset_y == 0.0f)
|
||||
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