pub struct SplitTreeDivider {
pub split_index: usize,
pub direction: SplitDirection,
pub position: f32,
pub axis_start: f32,
pub axis_size: f32,
pub cross_start: f32,
pub cross_size: f32,
pub thickness: f32,
}Expand description
Geometry of one internal Split node’s divider, resolved against a
concrete bounds rect. Pre-order split_index matches
SplitTree::set_ratio_at_index / SplitTree::adjust_ratio_at_index
/ SplitTree::parent_split_of addressing.
Fields§
§split_index: usizePre-order index of the Split node in the tree.
direction: SplitDirectionDirection of this split.
position: f32Divider position along the split axis (x for Horizontal, y for
Vertical) — the resolved, unrounded position. Backends snap it
to their native units when painting; see Self::cell_position
for the TUI convention.
axis_start: f32Start of the parent rect along the split axis. Combine with
axis_size to convert a drag cursor position back to a ratio:
ratio = (cursor_axis - axis_start) / axis_size. This is
exactly what crate::DragTarget::SplitDivider carries so a
drag can be resumed without re-running layout() on every
mouse-move.
axis_size: f32Size of the parent rect along the split axis. See axis_start.
cross_start: f32Start of the divider line along the cross axis.
cross_size: f32Length of the divider line along the cross axis.
thickness: f32Divider thickness along the split axis (native units). The
paintable/hit-testable band is [position, position + thickness).
Implementations§
Source§impl SplitTreeDivider
impl SplitTreeDivider
Sourcepub fn cell_position(&self) -> u16
pub fn cell_position(&self) -> u16
TUI-native cell coordinate this divider paints at. Truncates
toward zero — the same conversion ratatui-backed rasterisers use
for cell coordinates (as u16). Call this from BOTH paint and
hit-test so they can never diverge: this is the conversion
both a paint and hit-test path must use.
Sourcepub fn hit_tolerant(&self, axis_point: f32, tolerance: f32) -> bool
pub fn hit_tolerant(&self, axis_point: f32, tolerance: f32) -> bool
True if axis_point (native units, same axis as position)
falls within a symmetric tolerance band around this divider’s
paintable band [position, position + thickness) — the
GTK/macOS pixel-backend convention (a few px of forgiveness
either side of the exact divider line; exact-hit-only is
unusable at pixel precision).
Sourcepub fn cross_contains(&self, cross_point: f32) -> bool
pub fn cross_contains(&self, cross_point: f32) -> bool
True if cross_point falls within this divider’s cross-axis
extent (cross_start..cross_start + cross_size).
Trait Implementations§
Source§impl Clone for SplitTreeDivider
impl Clone for SplitTreeDivider
impl Copy for SplitTreeDivider
Source§impl Debug for SplitTreeDivider
impl Debug for SplitTreeDivider
Source§impl PartialEq for SplitTreeDivider
impl PartialEq for SplitTreeDivider
impl StructuralPartialEq for SplitTreeDivider
Auto Trait Implementations§
impl Freeze for SplitTreeDivider
impl RefUnwindSafe for SplitTreeDivider
impl Send for SplitTreeDivider
impl Sync for SplitTreeDivider
impl Unpin for SplitTreeDivider
impl UnsafeUnpin for SplitTreeDivider
impl UnwindSafe for SplitTreeDivider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more