Unity-UI-Extensions / com.unity.uiextensions

https://unity-ui-extensions.github.io/
1.26k stars 135 forks source link

Range slider size increases when clicked outside the right handle near the end of the full slider #369

Closed SimonDarksideJ closed 2 years ago

SimonDarksideJ commented 2 years ago

Issue created by Shyam H as Bitbucket Issue #​369 on 2021.04.02 17:31. I've tried this on an empty project on Unity 2019.4.0 using the bitbucket repo using the 2019.4 version

Steps to replicate:

  1. Import the package into an empty scene
  2. Add a range slider to the scene
  3. Hit play
  4. Make the range slider take up the left quarter of the slider(low at 0, high at 25%) (start.png in attachments)
  5. Click anywhere between the 25 and 100% area(click at the 75% mark, for example), and drag (clickLocation.png in attachments)
  6. The range slider will move to that area, but the size will also increase along with it (final.png in attachments)

SimonDarksideJ commented 2 years ago

On 2021.04.18 12:17, @SimonDarksideJ commented: Issue replicated, investigating :D

SimonDarksideJ commented 2 years ago

On 2021.04.18 13:34, @SimonDarksideJ commented: Fixed the issues where dragging outside the range slider handle causes the range to update.

Resolves #369

Referenced by 4426799f5fbc

SimonDarksideJ commented 2 years ago

On 2021.04.18 13:34 @SimonDarksideJ modified issue: status changed newresolved

SimonDarksideJ commented 2 years ago

On 2021.04.18 13:36, @SimonDarksideJ commented: Merged a fix Shyam H, you can either pull the source repo using the Git Options in UPM, or wait for the next package release.

SimonDarksideJ commented 2 years ago

On 2021.04.19 08:38, Shyam H commented: So, you’ve just disabled the ability for the whole bar to move if you select outside.

It used to work in one direction. Like if you did the same steps, but instead of having the bar start on the left, if you started on the right, the range won’t update, but the bar would move as intended.

And if you swap line 516 and 517 on RangeSlider.cs, the right side works as intended and the left side breaks.

SimonDarksideJ commented 2 years ago

On 2021.04.19 08:45, @SimonDarksideJ commented: It seemed to be the most sensible fix. You can now alter it by:

In testing it seemed the most logic approach.

Is there another use case you need that this doesn’t satisfy?

SimonDarksideJ commented 2 years ago

On 2021.04.19 10:11, Shyam H commented: No, this is good enough. I just said all of those, because those are what I found out.

SimonDarksideJ commented 2 years ago

On 2021.04.19 11:58, @SimonDarksideJ commented: Great stuff and thanks for your support!