Minor cleanup

Just from reading diff.
This commit is contained in:
Salman Ahmed 2022-04-28 06:52:42 +03:00
parent dacca73838
commit 2e8372fe90
4 changed files with 6 additions and 10 deletions

View File

@ -3,7 +3,6 @@
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Input.Events;
using osu.Framework.Testing;
using osu.Framework.Utils;
@ -63,7 +62,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
}));
AddStep("set beat divisor to 1/1", () =>
{
var beatDivisor = Editor.Dependencies.Get<BindableBeatDivisor>();
var beatDivisor = (BindableBeatDivisor)Editor.Dependencies.Get(typeof(BindableBeatDivisor));
beatDivisor.Value = 1;
});
}

View File

@ -8,7 +8,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Edit;
@ -91,15 +90,15 @@ namespace osu.Game.Tests.Visual.Editing
[Test]
public void TestDistanceSpacingHotkeys()
{
float originalSpacing = 0;
double originalSpacing = 0;
AddStep("retrieve original spacing", () => originalSpacing = (float)editorBeatmap.BeatmapInfo.DistanceSpacing);
AddStep("retrieve original spacing", () => originalSpacing = editorBeatmap.BeatmapInfo.DistanceSpacing);
AddStep("hold ctrl", () => InputManager.PressKey(Key.LControl));
AddStep("hold alt", () => InputManager.PressKey(Key.LAlt));
AddStep("scroll mouse 5 steps", () => InputManager.ScrollVerticalBy(5));
AddAssert("distance spacing increased by 0.5", () => Precision.AlmostEquals(editorBeatmap.BeatmapInfo.DistanceSpacing, originalSpacing + 0.5f));
AddAssert("distance spacing increased by 0.5", () => editorBeatmap.BeatmapInfo.DistanceSpacing == originalSpacing + 0.5);
AddStep("release alt", () => InputManager.ReleaseKey(Key.LAlt));
AddStep("release ctrl", () => InputManager.ReleaseKey(Key.LControl));

View File

@ -117,8 +117,6 @@ namespace osu.Game.Rulesets.Edit
},
new LeftToolboxFlow
{
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
Children = new Drawable[]
{
new EditorToolboxGroup("toolbox (1-9)")
@ -134,7 +132,7 @@ namespace osu.Game.Rulesets.Edit
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
},
},
}
}
},
};

View File

@ -84,7 +84,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
base.LoadComplete();
beatDivisor.BindValueChanged(_ => updateSpacing(), true);
beatDivisor.BindValueChanged(_ => updateSpacing());
distanceSpacingMultiplier = SnapProvider.DistanceSpacingMultiplier.GetBoundCopy();
distanceSpacingMultiplier.BindValueChanged(_ => updateSpacing(), true);