1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Always show rectangular grid in osu! composer

This commit is contained in:
Bartłomiej Dach 2021-09-20 20:13:06 +02:00
parent cdef6d0cf5
commit b5af01f456
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Osu.Edit
{
RelativeSizeAxes = Axes.Both
},
rectangularPositionSnapGridContainer = new Container
rectangularPositionSnapGrid = new OsuRectangularPositionSnapGrid(EditorBeatmap.BeatmapInfo.GridSize)
{
RelativeSizeAxes = Axes.Both
}
@ -89,8 +89,6 @@ namespace osu.Game.Rulesets.Osu.Edit
gridSnapToggle.ValueChanged += _ =>
{
updateRectangularPositionSnapGrid();
if (gridSnapToggle.Value == TernaryState.True)
distanceSnapToggle.Value = TernaryState.False;
};
@ -111,6 +109,8 @@ namespace osu.Game.Rulesets.Osu.Edit
private readonly Cached distanceSnapGridCache = new Cached();
private double? lastDistanceSnapGridTime;
private RectangularPositionSnapGrid rectangularPositionSnapGrid;
protected override void Update()
{
base.Update();
@ -298,21 +298,5 @@ namespace osu.Game.Rulesets.Osu.Edit
return new OsuDistanceSnapGrid((OsuHitObject)sourceObject, (OsuHitObject)targetObject);
}
private Container rectangularPositionSnapGridContainer;
private RectangularPositionSnapGrid rectangularPositionSnapGrid;
private void updateRectangularPositionSnapGrid()
{
rectangularPositionSnapGridContainer.Clear();
if (gridSnapToggle.Value == TernaryState.True)
{
rectangularPositionSnapGridContainer.Add(rectangularPositionSnapGrid = new OsuRectangularPositionSnapGrid(EditorBeatmap.BeatmapInfo.GridSize)
{
RelativeSizeAxes = Axes.Both
});
}
}
}
}