Skip to content

Fix sliders allowing values outside their number of stops - #5749

Merged
ab9rf merged 6 commits into
DFHack:developfrom
Halavus:gui-slider-min-max
Sep 28, 2026
Merged

ab9rf merged 6 commits into
DFHack:developfrom
Halavus:gui-slider-min-max

Conversation

@Halavus

@Halavus Halavus commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Clicking left and right only recorded -1 or +1 based on mouse position without any safeguard against potential larger frame than the slider itself. EDIT: Dragging was affected too.

Capture d'écran 2026-03-13 233008

If this PR makes an externally-visible change in behavior or API, please add an appropriate line to docs/changelog.txt.

Halavus added 2 commits March 14, 2026 00:13
Clicking left and right only did -1 & +1 without checking the validity of the result.
Comment thread library/lua/gui/widgets/slider.lua Outdated
ab9rf added 3 commits July 11, 2026 20:52
Applies the same num_stops clamping to RangeSlider's click-to-step
paths that Slider already had, and renames the internal slide_core
class to _SliderCore per naming conventions (CamelCase, leading
underscore marks it as not intended for direct instantiation).
@ab9rf
ab9rf requested a review from SilasD September 22, 2026 14:10
@ab9rf

ab9rf commented Sep 22, 2026

Copy link
Copy Markdown
Member

I've revised this PR based on the discussion above and also applied the same bug fix to RangeSlider

@SilasD SilasD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes you made look fine. ISTR wanting these changes but otherwise approving of the PR.

all good.

@ab9rf
ab9rf merged commit 6092a93 into DFHack:develop Sep 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants