Skip to main content

Module splitter

Module splitter 

Source
Expand description

Window splitter arithmetic, ported from upstream’s splitter.ts: clamping and rounding, what each key does, and how far a drag moves the bar.

Structs§

KeyContext
Everything a key press needs to know about the bar.

Enums§

SplitUnit
The unit a splitter’s value is in.

Functions§

drag_value
The value after dragging delta pixels from where a drag began at start. per_pixel is 100 divided by the split’s size for a percentage, 1 for pixels.
key_value
The value a key asks for, and the size to remember for Enter, or None for keys the splitter leaves alone. Arrows move the bar, not the value: whether that grows the pane depends on which side of the bar it is on, and in RTL Right is the inline start.
settle
Clamp to the bounds and round: tenths of a percent, whole pixels.