Skip to content

fix: Re-add the minimum value when calculating nearest tick for Slider's#3109

Open
Acissathar wants to merge 1 commit intostride3d:masterfrom
Acissathar:fix-slider-removes-min-without-adding-back
Open

fix: Re-add the minimum value when calculating nearest tick for Slider's#3109
Acissathar wants to merge 1 commit intostride3d:masterfrom
Acissathar:fix-slider-removes-min-without-adding-back

Conversation

@Acissathar
Copy link
Copy Markdown
Contributor

PR Details

CalculateClosestTick in Slider.cs subtracts the Minimum to convert into a relative offset, does the tick-snapping math in that relative space, but then returns times * step without translating it back to the absolute value. This makes it so that any value you enter is going to have the Minimum subtracted from it when Minimum is a non-zero value, even if this makes the value go below the Minimum.

Adding it back in at the very end makes both the value and minimum be respected:

SliderMinMaxFixed

Related Issue

#3108

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

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.

1 participant