1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 14:52:56 +08:00

Merge pull request #31453 from bdach/fix-juice-stream-placement-offset

Fix juice stream placement blueprint being initially visually offset
This commit is contained in:
Dean Herbert 2025-01-10 01:51:24 +09:00 committed by GitHub
commit 2133ac6d01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,9 +88,8 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints
switch (PlacementActive) switch (PlacementActive)
{ {
case PlacementState.Waiting: case PlacementState.Waiting:
if (!(result.Time is double snappedTime)) return;
HitObject.OriginalX = ToLocalSpace(result.ScreenSpacePosition).X; HitObject.OriginalX = ToLocalSpace(result.ScreenSpacePosition).X;
if (result.Time is double snappedTime)
HitObject.StartTime = snappedTime; HitObject.StartTime = snappedTime;
break; break;
@ -107,21 +106,13 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints
Vector2 startPosition = CatchHitObjectUtils.GetStartPosition(HitObjectContainer, HitObject); Vector2 startPosition = CatchHitObjectUtils.GetStartPosition(HitObjectContainer, HitObject);
editablePath.Position = nestedOutlineContainer.Position = scrollingPath.Position = startPosition; editablePath.Position = nestedOutlineContainer.Position = scrollingPath.Position = startPosition;
updateHitObjectFromPath(); if (lastEditablePathId != editablePath.PathId)
}
private void updateHitObjectFromPath()
{
if (lastEditablePathId == editablePath.PathId)
return;
editablePath.UpdateHitObjectFromPath(HitObject); editablePath.UpdateHitObjectFromPath(HitObject);
ApplyDefaultsToHitObject(); lastEditablePathId = editablePath.PathId;
ApplyDefaultsToHitObject();
scrollingPath.UpdatePathFrom(HitObjectContainer, HitObject); scrollingPath.UpdatePathFrom(HitObjectContainer, HitObject);
nestedOutlineContainer.UpdateNestedObjectsFrom(HitObjectContainer, HitObject); nestedOutlineContainer.UpdateNestedObjectsFrom(HitObjectContainer, HitObject);
lastEditablePathId = editablePath.PathId;
} }
private double positionToTime(float relativeYPosition) private double positionToTime(float relativeYPosition)