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:
smaster 2025-06-09 12:39:53 +02:00 committed by GitHub
parent 1fe10117b7
commit 54b4587f9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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