egui/crates
Gilberto Santos 1dea8fac9b
Fix scroll handle extending outside of `ScrollArea` (#5286)
* [x] I have followed the instructions in the PR template
* Closes https://github.com/emilk/egui/issues/3734

## Info

This PR addresses an issue where resizing a scroll handle can lead to
unwanted overlap.

It is also happening on the egui-demo.

![Screenshot 2024-10-18 at 17 35
25](https://github.com/user-attachments/assets/3a9527d9-fc46-4b25-b95a-9ba2fa54978e)

## Cause

*Note: The following explanation assumes a vertical scroll; however, the
logic applies equally to horizontal scrolling.*

When the scroll handle is positioned at the top or bottom of the scroll
area and the handle is resized to fit the minimum handle size, there is
a risk of overlap. This occurs if the handle’s new size extends beyond
the bounds of the scroll area.

## Proposed Solution

1. Check whether increasing the handle size will cause it to overlap
with the scroll area.
2. If an overlap is detected, adjust the handle’s center position by the
overlap amount, moving it towards the center of the scroll area.
2025-03-05 10:49:04 +01:00
..
ecolor Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
eframe Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui Fix scroll handle extending outside of `ScrollArea` (#5286) 2025-03-05 10:49:04 +01:00
egui-wgpu Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui-winit Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_demo_app Add `Ui::close` and `Response::should_close` (#5729) 2025-02-20 17:59:29 +01:00
egui_demo_lib ⚠️ Improved menu based on `egui::Popup` (#5716) 2025-03-03 14:56:30 +01:00
egui_extras Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_glow Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_kittest Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
epaint Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
epaint_default_fonts Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00