mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 01:08:56 +00:00
LibGui: Add bounding of rubber band to IconView
This ensures the selection rubber band in icon views stays within the visible area.
This commit is contained in:
parent
2c0df5e7e7
commit
cc829ed9d2
Notes:
sideshowbarker
2024-07-18 07:44:59 +09:00
Author: https://github.com/frhun
Commit: cc829ed9d2
Pull-request: https://github.com/SerenityOS/serenity/pull/8521
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg
1 changed files with 2 additions and 2 deletions
|
@ -246,9 +246,9 @@ void IconView::mouseup_event(MouseEvent& event)
|
|||
AbstractView::mouseup_event(event);
|
||||
}
|
||||
|
||||
bool IconView::update_rubber_banding(const Gfx::IntPoint& position)
|
||||
bool IconView::update_rubber_banding(const Gfx::IntPoint& input_position)
|
||||
{
|
||||
auto adjusted_position = to_content_position(position);
|
||||
auto adjusted_position = to_content_position(input_position.constrained(widget_inner_rect()));
|
||||
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…
Add table
Add a link
Reference in a new issue