1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

LibWeb: Don't paint borders with width <= 0px

Previously we would only check if the border width property is empty and
skip drawing in that case, and enforcing a minimum width of 1px
otherwise - but "border: 0;" should not paint a border :^)
This commit is contained in:
Linus Groh 2020-05-11 00:03:18 +01:00 committed by Andreas Kling
parent 8edf2bbcbd
commit a427821dd1

View file

@ -44,6 +44,8 @@ void LayoutBox::paint_border(RenderingContext& context, Edge edge, const Gfx::Fl
auto border_style = style().property(style_property_id);
float width = border_width.value()->to_length().to_px();
if (width <= 0)
return;
int int_width = max((int)width, 1);