mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
LibWeb: Add minimum thumb size
This change is intended to insure that the thumb control on the dialog will never be narrower than 50 pixels no matter how long the line it's displaying.
This commit is contained in:
parent
e2ff234ac2
commit
b86f57ebf7
Notes:
github-actions[bot]
2024-08-30 11:33:25 +00:00
Author: https://github.com/OnorioCatenacci 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b86f57ebf74 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1184 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/kalenikaliaksandr ✅
|
@ -279,8 +279,8 @@ Optional<PaintableBox::ScrollbarData> PaintableBox::compute_scrollbar_data(Scrol
|
|||
auto scrollport_size = direction == ScrollDirection::Horizontal ? padding_rect.width() : padding_rect.height();
|
||||
if (scroll_overflow_size == 0)
|
||||
return {};
|
||||
|
||||
auto thumb_length = scrollport_size * (scrollport_size / scroll_overflow_size);
|
||||
auto const min_thumb_length = 50;
|
||||
auto thumb_length = max(scrollport_size * (scrollport_size / scroll_overflow_size), min_thumb_length);
|
||||
CSSPixelFraction scroll_size = 0;
|
||||
if (scroll_overflow_size > scrollport_size)
|
||||
scroll_size = (scrollport_size - thumb_length) / (scroll_overflow_size - scrollport_size);
|
||||
|
|
Loading…
Reference in a new issue