mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:07:35 +00:00
LibWeb: Allow having a linear-gradient() as a background-image
This commit is contained in:
parent
d924e9ff60
commit
ee7e9e7c86
4 changed files with 11 additions and 7 deletions
|
@ -60,7 +60,7 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet
|
|||
color_box = get_box(background_layers->last().clip);
|
||||
|
||||
auto layer_is_paintable = [&](auto& layer) {
|
||||
return layer.image && layer.image->bitmap();
|
||||
return layer.background_image && layer.background_image->is_image() && layer.background_image->as_image().bitmap();
|
||||
};
|
||||
|
||||
bool has_paintable_layers = false;
|
||||
|
@ -86,7 +86,6 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet
|
|||
if (!layer_is_paintable(layer))
|
||||
continue;
|
||||
Gfx::PainterStateSaver state { painter };
|
||||
auto& image = *layer.image->bitmap();
|
||||
|
||||
// Clip
|
||||
auto clip_box = get_box(layer.clip);
|
||||
|
@ -94,6 +93,7 @@ void paint_background(PaintContext& context, Layout::NodeWithStyleAndBoxModelMet
|
|||
painter.add_clip_rect(clip_rect);
|
||||
ScopedCornerRadiusClip corner_clip { painter, clip_rect, clip_box.radii };
|
||||
|
||||
auto& image = *layer.background_image->as_image().bitmap();
|
||||
Gfx::FloatRect background_positioning_area;
|
||||
|
||||
// Attachment and Origin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue