Skip to content

Commit

Permalink
Merge pull request #31453 from bdach/fix-juice-stream-placement-offset
Browse files Browse the repository at this point in the history
Fix juice stream placement blueprint being initially visually offset
  • Loading branch information
peppy authored Jan 9, 2025
2 parents 074b743 + 18f1d62 commit 2133ac6
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ public override void UpdateTimeAndPosition(SnapResult result)
switch (PlacementActive)
{
case PlacementState.Waiting:
if (!(result.Time is double snappedTime)) return;

HitObject.OriginalX = ToLocalSpace(result.ScreenSpacePosition).X;
HitObject.StartTime = snappedTime;
if (result.Time is double snappedTime)
HitObject.StartTime = snappedTime;
break;

case PlacementState.Active:
Expand All @@ -107,21 +106,13 @@ public override void UpdateTimeAndPosition(SnapResult result)
Vector2 startPosition = CatchHitObjectUtils.GetStartPosition(HitObjectContainer, HitObject);
editablePath.Position = nestedOutlineContainer.Position = scrollingPath.Position = startPosition;

updateHitObjectFromPath();
}

private void updateHitObjectFromPath()
{
if (lastEditablePathId == editablePath.PathId)
return;
if (lastEditablePathId != editablePath.PathId)
editablePath.UpdateHitObjectFromPath(HitObject);
lastEditablePathId = editablePath.PathId;

editablePath.UpdateHitObjectFromPath(HitObject);
ApplyDefaultsToHitObject();

scrollingPath.UpdatePathFrom(HitObjectContainer, HitObject);
nestedOutlineContainer.UpdateNestedObjectsFrom(HitObjectContainer, HitObject);

lastEditablePathId = editablePath.PathId;
}

private double positionToTime(float relativeYPosition)
Expand Down

0 comments on commit 2133ac6

Please sign in to comment.