mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +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
|
|
@ -20,6 +20,7 @@ namespace Gfx {
|
|||
class PaintStyle : public RefCounted<PaintStyle> {
|
||||
public:
|
||||
virtual ~PaintStyle() = default;
|
||||
virtual bool is_visible() const { return true; }
|
||||
};
|
||||
|
||||
class SolidColorPaintStyle : public PaintStyle {
|
||||
|
|
@ -29,6 +30,8 @@ public:
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) SolidColorPaintStyle(color));
|
||||
}
|
||||
|
||||
bool is_visible() const override { return m_color.alpha() > 0; }
|
||||
|
||||
Color const& color() const { return m_color; }
|
||||
|
||||
private:
|
||||
|
|
@ -65,6 +68,11 @@ public:
|
|||
|
||||
Optional<float> repeat_length() const { return m_repeat_length; }
|
||||
|
||||
bool is_visible() const override
|
||||
{
|
||||
return any_of(m_color_stops, [](auto& stop) { return stop.color.alpha() > 0; });
|
||||
}
|
||||
|
||||
private:
|
||||
Vector<ColorStop, 4> m_color_stops;
|
||||
Optional<float> m_repeat_length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue