pub fn settle(value: f64, min: f64, max: f64, unit: SplitUnit) -> f64Expand description
Clamp to the bounds and round: tenths of a percent, whole pixels.
use fc_dioxus::behavior::splitter::{settle, SplitUnit};
assert_eq!(settle(35.04, 15.0, 70.0, SplitUnit::Percent), 35.0);
assert_eq!(settle(90.0, 15.0, 70.0, SplitUnit::Percent), 70.0);
assert_eq!(settle(191.6, 120.0, 288.0, SplitUnit::Px), 192.0);