-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Hi, seeing an issue with 0.17.0 of egui_dock.
Describe the bug
If there are 4 tabbed windows arranged with 3 vertical splits and the leftmost split is dragged towards the right-hand side, there is a point where the tabbed windows on the right are resized to a width that causes a panic.
thread 'main' panicked at C:\ncrdev\rust\egui_dock\src\widgets\dock_area\show\leaf.rs:1104:9:
assertion left != right failed
left: 0.0
right: 0.0
To Reproduce
Steps to reproduce the behavior:
- In the egui_dock main branch v0.17.0, build the examples using debug target. Rustc version is 1.89.0. Toolchain is stable-x86_64-pc-windows-msvc.
- Run simple.exe - should see this initially:
- Change the dock positions so the tabbed windows are docked vertically:
- Move the split between tab3 and tab1/tab2 window to the left reasonably slowly
- As the width of tab1/tab3, tab5 and tab4 decreases, eventually a panic occurs
- The output shows:
thread 'main' panicked at C:\ncrdev\rust\egui_dock\src\widgets\dock_area\show\leaf.rs:1104:9:
assertionleft != rightfailed
left: 0.0
right: 0.0
Expected behavior
Can resize the tabbed window width without panic OR the minimum_width style for a tab is adhered to as the separators are dragged. https://docs.rs/egui_dock/0.17.0/egui_dock/style/struct.TabStyle.html. Setting the minimum_width does not solve the issue - seems to be ignored as separators are dragged.
Screenshots
See above.
Additional context
The panic is on this line here in tab_bar_scroll(): https://github.com/Adanos020/egui_dock/blob/main/src/widgets/dock_area/show/leaf.rs#L1104
The available_width can end up being set to 0 in these lines here in tab_bar(): https://github.com/Adanos020/egui_dock/blob/main/src/widgets/dock_area/show/leaf.rs#L125 where the Style::TAB_ADD_BUTTON_SIZE/Style::TAB_CLOSE_ALL_BUTTON_SIZE/Style::TAB_COLLAPSE_BUTTON_SIZE is taken away from the available_width.
Full backtrace attached:
egui_dock_tab_resize_bug_backtrace.txt
Thanks.