JFLib

ui/slider.rs#

Source: lib/ui/slider.rs

impl Range

  • fn position(&self, value: i32, travel: i32) -> i32 Map a value to the slider's usable pixel travel. RG_LOG applies to positive, increasing bounds; all other bounds use linear mapping. Degenerate ranges or travel return zero. Values outside the range are clamped.
  • fn value_at(&self, position: i32, travel: i32) -> i32 Map pixel travel to the nearest integer value, before step snapping. The logarithmic inverse uses bounded binary search (at most 31 iterations). Keyboard steps and semantic values always remain in the original units.

Source: docs/API.md in the JFLib repository.