diff --git a/crates/ui/src/docking/render/mod.rs b/crates/ui/src/docking/render/mod.rs index 2f16a8d0..9867b24d 100644 --- a/crates/ui/src/docking/render/mod.rs +++ b/crates/ui/src/docking/render/mod.rs @@ -143,7 +143,7 @@ impl Renderer<'_, P> { let actions = self.divider_actions(root, path, response.delta); self.output.actions.extend(actions); } - self.intersections(ui, node, rect, path, split.divider, mark, root); + self.intersections(ui, (node, rect), path, split.divider, mark, root); if self.dividers.len() < crate::docking::model::MAX_NODES { self.dividers.push(DrawnDivider { path: path.clone(), axis: *axis, divider: split.divider }); } @@ -285,7 +285,7 @@ impl Renderer<'_, P> { /// Four-way handles where a divider drawn inside the split `node` (since `mark`) ends on /// the split's own divider: dragging one moves both dividers. - fn intersections(&mut self, ui: &mut Ui, node: &Node

, rect: Rect, path: &[bool], divider: Rect, mark: usize, root: (&Node

, Rect)) { + fn intersections(&mut self, ui: &mut Ui, (node, rect): (&Node

, Rect), path: &[bool], divider: Rect, mark: usize, root: (&Node

, Rect)) { let Node::Split { axis, .. } = node else { return }; let side = (self.style.gap * 3.0).max(12.0); let mut found = Vec::new(); diff --git a/crates/ui/src/docking/render/sizes.rs b/crates/ui/src/docking/render/sizes.rs index 8af0dd5a..1c44cc1a 100644 --- a/crates/ui/src/docking/render/sizes.rs +++ b/crates/ui/src/docking/render/sizes.rs @@ -15,6 +15,9 @@ use super::{dock::dock_rects, node_limits, split_bounds}; use crate::docking::{DockContent, DockStyle, Node, PanelLimits}; use crate::layout::{SplitAxis, SplitLayout, SplitSize, split_rect}; +/// A split's two children with the rects they are drawn in. +type Children<'n, P> = [(&'n Node

, Rect); 2]; + /// Room a group keeps above its minimum after a drop, so each of its dividers can still /// travel both ways. pub(in crate::docking) const DROP_MARGIN: f32 = 1.0; @@ -169,7 +172,7 @@ impl

Sizer<'_, P> { /// The ancestors that continue the line of the split at the end of `chain` along `axis`: /// each with its children and whether the line runs through its second child, nearest first. /// The line ends at a split across the axis or beside a dock. - fn line<'n>(&self, chain: &[(&'n Node

, Rect)], path: &[bool], axis: SplitAxis) -> Vec<(usize, [(&'n Node

, Rect); 2], bool)> { + fn line<'n>(&self, chain: &[(&'n Node

, Rect)], path: &[bool], axis: SplitAxis) -> Vec<(usize, Children<'n, P>, bool)> { let mut line = Vec::new(); for depth in (0..path.len()).rev() { let Some(&(node, rect)) = chain.get(depth) else { break };