Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dgoodnow-ML
Copy link

@dgoodnow-ML dgoodnow-ML commented Oct 17, 2024

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 range

Additionally 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 starting StartSliderValue for snapped slider manipulations

resolves #944

…er is configured for grab interaction (IsTouchable = false)
@dgoodnow-ML dgoodnow-ML force-pushed the 944-fix-grabbable-sliders branch from 8bc1f68 to da0cd07 Compare October 17, 2024 07:41
@dgoodnow-ML
Copy link
Author

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.

@shaynie
Copy link
Contributor

shaynie commented Oct 18, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@shaynie
Copy link
Contributor

shaynie commented Oct 23, 2024

@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";
Copy link
Contributor

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.

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.

[BUG] Non-touchable slider sticks at maximum value when direct grabbed and maximum value greater than 1
3 participants