diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-27 20:53:28 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-27 20:53:28 +0100 |
commit | 70fadbad37676500037a45778f6480399dc07623 (patch) | |
tree | 125dcac13afaa5fceb42066712076cbb1aa84564 | |
parent | 478cfae7c857ad4a09adc5473440145cd60633ee (diff) | |
download | serenity-70fadbad37676500037a45778f6480399dc07623.zip |
LibHTML: Respect "border-style: dotted"
Dotted borders are now painted correctly (as long as they are 1px wide)
which is yet another little improvement to my Apache2 default page :^)
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutBox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Libraries/LibHTML/Layout/LayoutBox.cpp b/Libraries/LibHTML/Layout/LayoutBox.cpp index b0ecabe3fa..43972cf501 100644 --- a/Libraries/LibHTML/Layout/LayoutBox.cpp +++ b/Libraries/LibHTML/Layout/LayoutBox.cpp @@ -72,12 +72,12 @@ void LayoutBox::paint_border(RenderingContext& context, Edge edge, const FloatRe auto top_left_color = Color::from_rgb(0x888888); auto bottom_right_color = Color::from_rgb(0x5a5a5a); color = (edge == Edge::Left || edge == Edge::Top) ? top_left_color : bottom_right_color; - } else { - // border-style: solid } + bool dotted = border_style.has_value() && border_style.value()->to_string() == "dotted"; + auto draw_line = [&](auto& p1, auto& p2) { - context.painter().draw_line({ (int)p1.x(), (int)p1.y() }, { (int)p2.x(), (int)p2.y() }, color, 1); + context.painter().draw_line({ (int)p1.x(), (int)p1.y() }, { (int)p2.x(), (int)p2.y() }, color, 1, dotted); }; auto width_for = [&](CSS::PropertyID property_id) -> float { |