Fix duration fluctuations and one-frame jitters when editing juice streams #29019
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.
All of this code is a bit inscrutable and difficult to work with, but these changes appear to help.
Fix
EditablePath.UpdateHitObjectFromPath()
not automatically updating objectThis is important because the editable path conversions heavily depend on the value of
JuiceStream.Velocity
being correct. The value is only guaranteed to be correct after anApplyDefaults()
call, which is triggered by updating the object viaEditorBeatmap
.Fix editing juice stream path sometimes changing its duration
I'm not super sure why this works, but it appears to, and my educated guess as to why is that it counteracts the effects of a change in the SV of the juice stream by artificially increasing or decreasing the velocity when running the appropriate path conversions and expected distance calculations. The actual SV change takes effect on the next default application, which is triggered by the
Update()
call at the end of the method.Fix tests
These are again, seemingly arbitrary changes to tests, but I could not salvage this otherwise.
EditorBeatmap.Update()
call that control point would be allowed to live, but after adding it, the path goes through an extra conversion step that removes the point as it is redundant, and that seems more sane to me.This is all weird and strange and I would once again ask to look away because none of this is new breakage.