Ver código fonte

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 :^)
Linus Groh 5 anos atrás
pai
commit
a427821dd1
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      Libraries/LibWeb/Layout/LayoutBox.cpp

+ 2 - 0
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);
     auto border_style = style().property(style_property_id);
     float width = border_width.value()->to_length().to_px();
     float width = border_width.value()->to_length().to_px();
+    if (width <= 0)
+        return;
 
 
     int int_width = max((int)width, 1);
     int int_width = max((int)width, 1);