mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 13:18:19 +00:00
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:
parent
1f1276ffb1
commit
04526261c3
Notes:
sideshowbarker
2024-07-17 04:34:25 +09:00
Author: https://github.com/simonkrauter
Commit: 04526261c3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/620
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue