Add bound checks for resizing right dock (#32246)
Closes #30293 [Before](https://github.com/user-attachments/assets/0b95e317-391a-4d90-ba78-ed3d4f10871d) | [After](https://github.com/user-attachments/assets/23002a73-103c-4a4f-a7a1-70950372c9d9) Release Notes: - Fixed right panel expanding in backwards, when dragged out of its intended bounds, by adding a bounds check to ensure its size never gets to high.
This commit is contained in:
parent
1fe10117b7
commit
54b4587f9a
1 changed files with 9 additions and 1 deletions
|
@ -6255,7 +6255,15 @@ fn resize_right_dock(
|
|||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) {
|
||||
let size = new_size.max(workspace.bounds.left() - RESIZE_HANDLE_SIZE);
|
||||
let mut size = new_size.max(workspace.bounds.left() - RESIZE_HANDLE_SIZE);
|
||||
workspace.left_dock.read_with(cx, |left_dock, cx| {
|
||||
let left_dock_size = left_dock
|
||||
.active_panel_size(window, cx)
|
||||
.unwrap_or(Pixels(0.0));
|
||||
if left_dock_size + size > workspace.bounds.right() {
|
||||
size = workspace.bounds.right() - left_dock_size
|
||||
}
|
||||
});
|
||||
workspace.right_dock.update(cx, |right_dock, cx| {
|
||||
if WorkspaceSettings::get_global(cx)
|
||||
.resize_all_panels_in_dock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue