pub enum Edge {
Left,
Right,
Top,
Bottom,
}Expand description
Which side of a window was grabbed.
Not an axis, and the difference is the whole of #120. A window that is the right-hand child of a vertical split has that split’s seam on its left. Dragging its left edge moves that seam; dragging its right edge must find a different seam, or none at all. An axis cannot tell those two apart, so a layout handed only “horizontal” moves whichever seam the walk to the root meets first — which for a right-edge drag is the seam on the far side, and the window’s left edge then jumps while the edge under the pointer sits still. Measured: the slot’s x moved 209px in one frame while its width did not change at all.
The compositor has known the side all along — ResizeEdge in state.rs,
which the floating path already uses — and reduced it to a pair of booleans
on the way to the layout.
Variants§
Left
The low-x side, which a vertical split’s seam bounds from the left.
Right
The high-x side.
Top
The low-y side, which a horizontal split’s seam bounds from above.
Bottom
The high-y side.
Implementations§
Source§impl Edge
impl Edge
Sourceconst fn child(self) -> usize
const fn child(self) -> usize
Which child of a split has that split’s seam on this side.
A split’s seam lies between its two children, so the child that has the seam on its left — or above it — is the second one, and the child that has it on its right or below is the first. This single index is what turns “a branch cut the right way” into “the branch whose seam is actually under the pointer”.