mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-26 23:11:34 +03:00
LibGUI: Properly limit the icon view rubber band rect to the widget
Previously the rubber band rect of IconView was not properly constrained to the widget inner rect, leaving a one pixel gap on the bottom and right side. This patch removes the gap by inflating the constraint rect by one pixel on each axis.
This commit is contained in:
parent
5190f4e605
commit
e42a9cf957
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/e42a9cf957 Pull-request: https://github.com/SerenityOS/serenity/pull/15194
@ -246,7 +246,7 @@ void IconView::mouseup_event(MouseEvent& event)
|
||||
|
||||
bool IconView::update_rubber_banding(Gfx::IntPoint const& input_position)
|
||||
{
|
||||
auto adjusted_position = to_content_position(input_position.constrained(widget_inner_rect()));
|
||||
auto adjusted_position = to_content_position(input_position.constrained(widget_inner_rect().inflated(1, 1)));
|
||||
if (m_rubber_band_current != adjusted_position) {
|
||||
auto prev_rect = Gfx::IntRect::from_two_points(m_rubber_band_origin, m_rubber_band_current);
|
||||
auto prev_rubber_band_fill_rect = prev_rect.shrunken(1, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user