From 04526261c32c267b20a54b1ce94ff9f31ccb338b Mon Sep 17 00:00:00 2001 From: simonkrauter Date: Sat, 13 Jul 2024 17:49:22 -0300 Subject: [PATCH] LibWeb: Use shorter variant of `fill_rect_with_rounded_corners()` Instead of passing `thumb_corner_radius` 4 times, pass it only once. --- Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index 73d44ecd4de..195ad881e35 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -343,11 +343,11 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const int thumb_corner_radius = static_cast(context.rounded_device_pixels(scrollbar_thumb_thickness / 2)); if (auto thumb_rect = scroll_thumb_rect(ScrollDirection::Horizontal); thumb_rect.has_value()) { auto thumb_device_rect = context.enclosing_device_rect(thumb_rect.value()); - context.display_list_recorder().fill_rect_with_rounded_corners(thumb_device_rect.to_type(), color, thumb_corner_radius, thumb_corner_radius, thumb_corner_radius, thumb_corner_radius); + context.display_list_recorder().fill_rect_with_rounded_corners(thumb_device_rect.to_type(), color, thumb_corner_radius); } if (auto thumb_rect = scroll_thumb_rect(ScrollDirection::Vertical); thumb_rect.has_value()) { auto thumb_device_rect = context.enclosing_device_rect(thumb_rect.value()); - context.display_list_recorder().fill_rect_with_rounded_corners(thumb_device_rect.to_type(), color, thumb_corner_radius, thumb_corner_radius, thumb_corner_radius, thumb_corner_radius); + context.display_list_recorder().fill_rect_with_rounded_corners(thumb_device_rect.to_type(), color, thumb_corner_radius); } }