Smarter Handle Selection #114
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bugs #3736 and #3467 both seem to be related to handle selection. When handle values or positions overlap there may be confusion about the intended Handle to move. I added logic to defer the selection from mouse-down to mouse-move when mouse-down happens over the colliding parts of two or more handles. I added logic to choose the "best" handle when the handle values overlap and a mouse-click event is interpreted. Previously it was always choosing the first (bottom-most) handle on same-value mouse-click events, which explains the can-only-move-bottom-handle on overlap behavior. These changes should allow smart-selection from an arbitrary number of colliding handles, not just two. All other existing slider behaviors (such as not sliding past your neighbor) stay the same. The fix turned into more than just a few tweaked lines as I needed to store a list of overlapping handles and the original event as well as refer to the slider's orientation to help determine what to do. Works like a charm though!
As an added bonus, there is now enough info available to "swap" sliders as you move a handle pass a neighbor, so you could "pass" a neighbor without reordering the handles themselves, though this is not implemented.