diff --git a/crates/ui-contract/src/contract/body/window.rs b/crates/ui-contract/src/contract/body/window.rs index 0e76ad2dc3..ffe88ce169 100644 --- a/crates/ui-contract/src/contract/body/window.rs +++ b/crates/ui-contract/src/contract/body/window.rs @@ -449,10 +449,6 @@ impl BodyHooks<'_> { _ => return, }; let Some(began) = self.mode.began else { return }; - eprintln!( - "DIAG escape_during_a_pane_title_drag_cancels_it_and_reaches_nothing_else: began={began:?} core_rect={rect:?} current={:?}/{:?}", - current.pos, current.size - ); let (dx, dy, _) = grip.map_or((0, 0, CursorIcon::Grab), |index| GRIPS[index]); let kind = if grip.is_some() { PlacementKind::Size(edge_of(dx, dy)) } else { PlacementKind::Move }; let next = match pos { diff --git a/crates/ui-panels/src/docking/floating.rs b/crates/ui-panels/src/docking/floating.rs index 7bbd47ba43..3d344b103c 100644 --- a/crates/ui-panels/src/docking/floating.rs +++ b/crates/ui-panels/src/docking/floating.rs @@ -500,8 +500,9 @@ impl Container for FloatingGroup<'_> { if let Some(column) = self.column.filter(|column| column.collapsed.is_some()) { // The collapsed window moves; the rect keeps its expanded size. change.rect = column.kept(change.rect, self.rect, self.header, self.rtl); - } else if fitted && change.kind == PlacementKind::Move { - // A window its content sizes moves; the rect keeps its size. + } else if (fitted || self.sized == Sizing::Content) && change.kind == PlacementKind::Move { + // A window its content sizes moves (a cancel too, which reports the rect from before the gesture); the + // rect keeps the size the caller gave, not the one measured from the body. change.rect = Rect::from_min_size(change.rect.min, self.rect.size()); } else if self.minimized { change.rect = Rect::from_min_size(change.rect.min, Vec2::new(change.rect.width(), self.rect.height())); diff --git a/crates/ui-patterns/src/patterns/dock/panes.rs b/crates/ui-patterns/src/patterns/dock/panes.rs index 13998ebe40..0cb160961e 100644 --- a/crates/ui-patterns/src/patterns/dock/panes.rs +++ b/crates/ui-patterns/src/patterns/dock/panes.rs @@ -794,7 +794,6 @@ fn show_floating(ui: &mut // A cancelled move or resize (Escape) reports the rect from before the gesture: the app takes it back, as the // steps of the gesture moved its kept rect. A click on the title with no drag reports nothing. if let Some(change) = shown.placed { - eprintln!("DIAG escape_during_a_pane_title_drag_cancels_it_and_reaches_nothing_else: placed {:?} kind {:?} given {rect:?}", change.rect, change.kind); pass.sink.borrow_mut().push(PaneRequest::FloatRect(pane.pane.clone(), change.rect)); } if shown.minimized_toggled {