LibWeb: Use shorter variant of fill_rect_with_rounded_corners()

Instead of passing `thumb_corner_radius` 4 times, pass it only once.
This commit is contained in:
simonkrauter 2024-07-13 17:49:22 -03:00 committed by Andreas Kling
commit 04526261c3
Notes: sideshowbarker 2024-07-17 04:34:25 +09:00

View file

@ -343,11 +343,11 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
int thumb_corner_radius = static_cast<int>(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<int>(), 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<int>(), 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<int>(), 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<int>(), color, thumb_corner_radius);
}
}