summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2022-09-10 21:09:11 +0200
committerLinus Groh <mail@linusgroh.de>2022-09-11 21:39:32 +0100
commite42a9cf9575de2d815cacf3741b10bb0d92873d4 (patch)
treede698d6e437a60dbe28de80650eebb9b186cc84c /Userland/Libraries
parent5190f4e605c045f54e92d9e20c309dd3359c2519 (diff)
downloadserenity-e42a9cf9575de2d815cacf3741b10bb0d92873d4.zip
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/IconView.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp
index 991ef68017..6b05fcdff2 100644
--- a/Userland/Libraries/LibGUI/IconView.cpp
+++ b/Userland/Libraries/LibGUI/IconView.cpp
@@ -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);