diff options
author | Linus Groh <mail@linusgroh.de> | 2020-05-11 00:03:18 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-11 10:48:54 +0200 |
commit | a427821dd1c331c0828f6b113865787cfbfb42cc (patch) | |
tree | 340d0c5e3f17475932d0c031a660d50c349675a9 /Libraries | |
parent | 8edf2bbcbd5c1549335eadae2e781f4fcc5c1b54 (diff) | |
download | serenity-a427821dd1c331c0828f6b113865787cfbfb42cc.zip |
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 :^)
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutBox.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutBox.cpp b/Libraries/LibWeb/Layout/LayoutBox.cpp index 7ae34fad68..3de1fa3584 100644 --- a/Libraries/LibWeb/Layout/LayoutBox.cpp +++ b/Libraries/LibWeb/Layout/LayoutBox.cpp @@ -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); |