Skip to content

Unbounded sliders (vmax = FLT_MAX / INT_MAX) rendered as an empty box — now a recentring drag handle #19

Description

@barrulus

Informational — implemented in 3ff903a on feature/meta-migration. Filing so the behaviour
change is recorded and so the reasoning is available if you would rather it worked differently.

The problem

SliderFloat / SliderInt only draw a fill bar when the range is bounded, which is correct — an
unbounded range has no ratio to fill. But the result was a box containing a label, a number and
nothing else, at every value. It reads as a broken or disabled widget, and it sits directly beside
normal filled sliders in the same panel, which makes it look worse.

It is not a rare corner: Hesiod declares ~98 float attributes with vmax = FLT_MAX and 15
int attributes with INT_MAX. In the Rifts panel the default-noise Amplitude and
Spatial Frequency were both blank while Smoothness (0…1) right below them drew a bar. Dragging
worked the whole time — the widget falls back to a fixed pixels-per-unit — so the values changed
with no visual feedback whatsoever.

What it does now

Unbounded sliders paint a handle instead of a fill: centred at rest, following the cursor (clamped
to the track) while dragging, with a tick marking the rest position and a brighter shade while
held, springing back to centre on release. A directional drag counter rather than a slider. The
handle's travel is an affordance only — once it reaches an end the value keeps changing, as an
unbounded range implies.

Image

Deliberately unchanged: relative drag at the existing pixels-per-unit, Ctrl fine, Shift coarse,
Ctrl+Shift committing per step, double-click to type. The handle also feeds the existing two-pass
text draw, so label and value keep HighlightedText contrast where they overlap it. Bounded
sliders are untouched.

Also folded in: is_range_bounded() replaces four ad-hoc copies of the bounded test in each
widget, and additionally requires vmax > vmin, so a degenerate range gets a handle rather than an
empty box too.

Open question

Currently displacement maps to a value delta, so releasing stops the change. The alternative is a
true jog wheel — hold at an offset and the value keeps ticking at a speed proportional to
displacement. That needs a timer and changes the feel, so it was not done; say if you would prefer
it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    theme: attributes-widgetsMeta widgets, sliders, brush/array editors, theming/palette

    Type

    No type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions