-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix direct-grab sliders getting stuck at maximum value #945
base: main
Are you sure you want to change the base?
Fix direct-grab sliders getting stuck at maximum value #945
Conversation
…er is configured for grab interaction (IsTouchable = false)
8bc1f68
to
da0cd07
Compare
I added the tests and test prefabs to the uxcore project, although they are based on the canvas slider components in the UX components package. Let me know if I should relocate the tests and supporting prefabs somewhere more appropriate. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@AMollis, please review for tests and test locations |
public class SliderTests : BaseRuntimeInputTests | ||
{ | ||
private const string TouchSliderPrefabPath = | ||
"Packages/org.mixedrealitytoolkit.uxcore/Tests/Runtime/Prefabs/TouchSliderTest.prefab"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UXCore package is not meant to have prefabs in it. And I would hate to have to maintain two sets of prefabs (one in UXCore and one in UXComponents)
So please move this unit tests to UXComponents, and add use the official prefabs.
Fixes direct-grab sliders getting stuck at the maximum value when the slider value range is not 0-1.
Remap
StartSliderValue
to normalized range before applying normalized interactor movement and clamping to 0-1 rangeAdditionally fixes issue with non-grab sliders snapping to 0 or maximum value when slider minimum value is less than 0 (not covered in issue description, found during testing)
Use minimum slider value instead of
0
as startingStartSliderValue
for snapped slider manipulationsresolves #944