-
Notifications
You must be signed in to change notification settings - Fork 2k
panic in ScrollArea in egui 0.32.0 #7362
Copy link
Copy link
Closed
Labels
bugSomething is brokenSomething is broken
Milestone
Description
Describe the bug
When clicking a scroll area's resize handle, I get an instant panic caused by a debug assertion.
The scroll area is the one belonging to an egui_extra table, and not one that I created.
To Reproduce
Steps to reproduce the behavior:
- Run MakerPnP planner_egui @ rev
d3f1c30718da433df8c485e01d88d3258ef802ae - Open a project
- Double click the unit assignments in the treeview.
- Left click the scrollbar.
- Observe panic.
Screenshots
Desktop (please complete the following information):
- OS: Windows 11
- Browser: N/A
Smartphone (please complete the following information):
N/A
Additional context
I added debug info to scroll_area.rs:
let new_handle_top = pointer_pos[d] - *scroll_start_offset_from_top_left;
println!("new_handle_top: {:?}", new_handle_top);
println!("scroll_bar_rect: {:?}", scroll_bar_rect);
let from = scroll_bar_rect.min[d]..=(scroll_bar_rect.max[d] - handle_rect.size()[d]);
println!("from: {:?}", from);
state.offset[d] = remap(
new_handle_top,
from,
0.0..=max_offset[d],
);the output is:
new_handle_top: 332.0
scroll_bar_rect: [[481.0 332.0] - [1257.0 372.0]]
from: 332.0..=332.0
and the panic is:
thread 'main' panicked at D:\Users\Hydra\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\emath-0.32.0\src\lib.rs:152:5:
from.start() and from.end() should not be equal
Here's a link to the source:
Additionally, as per the screenshot, there are two extremely similar tables in the UI, the second one does not panic, the debug output when it is clicked is:
new_handle_top: 455.0
scroll_bar_rect: [[533.0 455.0] - [1475.0 495.0]]
from: 455.0..=481.99188
if you resize the second one, so that all the elements are visible, and then click it, it too panics, like this:
new_handle_top: 455.0
scroll_bar_rect: [[533.0 455.0] - [1475.0 600.0]]
from: 455.0..=455.0
thread 'main' panicked at D:\Users\Hydra\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\emath-0.32.0\src\lib.rs:152:5:
from.start() and from.end() should not be equal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething is brokenSomething is broken