Fix reversing straight perfect curve sliders positioning them weirdly#36698
Conversation
To be sure we will always get a slider arc path containing something like "0.0001478..."
This assertion does'nt need to run only for pathIndex 2
|
I don't get it. In #35919 (comment) you've pointed out that I was wrong about the current solution "preserving relative placement of the anchors". So I'd rather take the simple solution you had in #35919 (comment) over this. Just maybe check that the slider length adjustment feature doesn't break with your solution. |
|
I think i got things a little bit confused here my bad, anyways good thing we can go with the simplest solution.
If by check you mean a test case i don't think this will be necessary, |
|
I mean I'm not 100% certain that your assumption that Or actually I'm not even sure this will work correctly for multi-segment sliders even. |
|
Ohh i see what you mean, i thought you were talking about the timeline lenght adjust, i never noticed that this ring at the end of the slider reduced its size, it indeed needs a test then. As you predicted it did break multi segmented sliders. Maybe we can keep the current behaviour for multi-segmented sliders and apply the Screencast.From.2026-02-19.09-29-09.mp4 |
|
You can use part of the previous code. It was fetching |
Add checks to see if reducing sliders with SliderEndDragMarker does not break anything
…'s middle Uses lastSegmentStart lastSegmentEnd to determine the middle of the slider instead of assuming it is sliderPath.positionAt(0.5)
Closes #35919
To find the right position for the middle control point the code currently retrieves the slider's path to the end, saves it at
circleArcPathand uses the middle index withcircleArcPath.Count / 2to reposition the middle control point.If the slider is perfectly straight aligned its
circleArcPathcan look like:or
In example 1 the picked index is the end of the slider
In example 2 the picked index is the start of the slider
This PR adds a check to see if there are more than two unique values in the
circleArcPath, rounding the coordinates to deal with a possible float number.If we have more than two the behavior is kept unchanged, if we don't have more than 2 unique coordinates the slider does not have an arc and we can use the last control point's coordinates divided by 2 to find the middle of the slider.
before.mp4
after.mp4