Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete entire juice stream when only one vertex remains after deleting another vertex #31452

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Jan 8, 2025

Closes #31425.

Matches handling of sliders:

// If there are 0 or 1 remaining control points, or the slider has an invalid length, it is in a degenerate form and should be deleted
if (controlPoints.Count <= 1 || !HitObject.Path.HasValidLength)
{
placementHandler?.Delete(HitObject);
return;
}

@@ -92,7 +92,7 @@ public void InitializeFromHitObject(JuiceStream hitObject)
}));
}

public void UpdateHitObjectFromPath(JuiceStream hitObject)
public virtual void UpdateHitObjectFromPath(JuiceStream hitObject)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason for having this virtual and the actual logic only live in the selection subclass is that the logic breaks placement if put here. There are other protections in place already against placement allowing zero length:

protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0);

@bdach bdach self-assigned this Jan 8, 2025
@smoogipoo smoogipoo merged commit c72cb01 into ppy:master Jan 9, 2025
10 checks passed
@bdach bdach deleted the delete-juice-stream-if-path-degenerates branch January 9, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

catch editor: deleting a repeated JuiceStream's verts until only the first one remains creates a cursed fruit
2 participants