mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
LibWeb: Stop 'no-repeat' from expanding the background area
Previously, a `background-repeat` value of `no-repeat` in a direction would cause the image to be drawn at exactly that size. This was fine if the image was smaller than the element, but if it was larger, it would draw outside its bounds. Now, it behaves itself. :^)
This commit is contained in:
parent
ecf1b7f977
commit
64d805a027
Notes:
sideshowbarker
2024-07-18 01:02:28 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/64d805a027f Pull-request: https://github.com/SerenityOS/serenity/pull/10946
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ void paint_background(PaintContext& context, Gfx::IntRect const& background_rect
|
||||||
// The background rect is already sized to align with 'repeat'.
|
// The background rect is already sized to align with 'repeat'.
|
||||||
break;
|
break;
|
||||||
case CSS::Repeat::NoRepeat:
|
case CSS::Repeat::NoRepeat:
|
||||||
image_rect.set_width(background_data.image->width());
|
image_rect.set_width(min(image_rect.width(), background_data.image->width()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ void paint_background(PaintContext& context, Gfx::IntRect const& background_rect
|
||||||
// The background rect is already sized to align with 'repeat'.
|
// The background rect is already sized to align with 'repeat'.
|
||||||
break;
|
break;
|
||||||
case CSS::Repeat::NoRepeat:
|
case CSS::Repeat::NoRepeat:
|
||||||
image_rect.set_height(background_data.image->height());
|
image_rect.set_height(min(image_rect.height(), background_data.image->height()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue