Skip to content

Commit e48d801

Browse files
fix: revert assertPosition to AddAssert, fix InspectCode warnings (blank lines, redundant qualifiers)
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/f6a724cd-01fb-4c3e-8c92-b27fbcfada86 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 8114fe2 commit e48d801

11 files changed

Lines changed: 16 additions & 22 deletions

File tree

osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33

44
#nullable disable
55

6-
using System.Collections.Generic;
76
using System;
7+
using System.Collections.Generic;
88
using System.Numerics;
9-
9+
using JetBrains.Annotations;
1010
using osu.Framework.Allocation;
11-
using osu.Framework.Graphics.Containers;
1211
using osu.Framework.Graphics;
12+
using osu.Framework.Graphics.Containers;
1313
using osu.Framework.Utils;
14-
1514
using osu.Game.Rulesets.Objects.Drawables;
1615
using osu.Game.Rulesets.Osu.Skinning.Default;
1716
using osu.Game.Skinning;
1817

19-
using JetBrains.Annotations;
20-
2118
namespace osu.Game.Rulesets.Osu.Objects.Drawables
2219
{
2320
public partial class DrawableSliderRepeat : DrawableOsuHitObject

osu.Game.Tests/Visual/Gameplay/TestSceneDrawableScrollingRuleset.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ private void assertChildPosition(int index) => AddAssert($"hitobject {index} chi
235235
yScale * (float)((TestParentHitObject)d.HitObject).ChildTimeOffset / time_range, 0.1f);
236236
});
237237

238-
private void assertPosition(int index, float relativeY) => AddUntilStep($"hitobject {index} at {relativeY}",
239-
() => Precision.AlmostEquals(getDrawableHitObject(index)?.DrawPosition.Y / yScale ?? -1, relativeY, Precision.FLOAT_EPSILON));
238+
private void assertPosition(int index, float relativeY) => AddAssert($"hitobject {index} at {relativeY}",
239+
() => getDrawableHitObject(index)?.DrawPosition.Y / yScale ?? -1, () => Is.EqualTo(relativeY).Within(Precision.FLOAT_EPSILON));
240240

241241
private void setTime(double time)
242242
{

osu.Game.Tests/Visual/UserInterface/TestSceneUprightAspectMaintainingContainer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ from rotation in rotationSteps
172172

173173
private bool uprightAspectMaintainingContainerStateIsValid(Container parent, UprightAspectMaintainingContainer child)
174174
{
175-
System.Numerics.Matrix3x2 parentMatrix = parent.DrawInfo.Matrix;
176-
System.Numerics.Matrix3x2 childMatrix = child.DrawInfo.Matrix;
175+
Matrix3x2 parentMatrix = parent.DrawInfo.Matrix;
176+
Matrix3x2 childMatrix = child.DrawInfo.Matrix;
177177
float childScaleX = MathF.Sqrt(childMatrix.M11 * childMatrix.M11 + childMatrix.M12 * childMatrix.M12);
178178
float childScaleY = MathF.Sqrt(childMatrix.M21 * childMatrix.M21 + childMatrix.M22 * childMatrix.M22);
179179
float parentScaleX = MathF.Sqrt(parentMatrix.M11 * parentMatrix.M11 + parentMatrix.M12 * parentMatrix.M12);

osu.Game/Beatmaps/Drawables/DifficultyIconTooltip.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void SetContent(DifficultyIconTooltipContent content)
136136
bpm.Text = " BPM: " + Math.Round(bpmAdjusted, 0);
137137
}
138138

139-
public void Move(System.Numerics.Vector2 pos) => Position = pos;
139+
public void Move(Vector2 pos) => Position = pos;
140140

141141
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
142142

osu.Game/Collections/DrawableCollectionListItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private void load(OsuColour colours)
236236
};
237237
}
238238

239-
public override bool ReceivePositionalInputAt(System.Numerics.Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) && !IsTextBoxHovered(screenSpacePos);
239+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) && !IsTextBoxHovered(screenSpacePos);
240240

241241
protected override bool OnHover(HoverEvent e)
242242
{

osu.Game/Graphics/Carousel/Carousel.ScrollContainer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ protected partial class ScrollContainer : UserTrackingScrollContainer, IKeyBindi
4646
/// <summary>
4747
/// Allow handling right click scroll outside of the carousel's display area.
4848
/// </summary>
49-
public override bool ReceivePositionalInputAt(System.Numerics.Vector2 screenSpacePos) => true;
49+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
5050

5151
public ScrollContainer()
52-
{
5352
// Managing our own custom layout within ScrollContent causes feedback with public ScrollContainer calculations,
5453
// so we must maintain one level of separation from ScrollContent.
5554
base.Add(Panels = new Container
@@ -81,7 +80,7 @@ public override void Add(Drawable drawable)
8180
Panels.Add(drawable);
8281
}
8382

84-
public override double GetChildPosInContent(Drawable d, System.Numerics.Vector2 offset)
83+
public override double GetChildPosInContent(Drawable d, Vector2 offset)
8584
{
8685
if (d is not ICarouselPanel panel)
8786
return base.GetChildPosInContent(d, offset);

osu.Game/Graphics/Containers/OsuRearrangeableListItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ protected override void OnDragEnd(DragEndEvent e)
115115
base.OnDragEnd(e);
116116
}
117117

118-
protected override bool IsDraggableAt(System.Numerics.Vector2 screenSpacePos) => handle.HandlingDrag;
118+
protected override bool IsDraggableAt(Vector2 screenSpacePos) => handle.HandlingDrag;
119119

120120
protected override bool OnHover(HoverEvent e)
121121
{

osu.Game/Graphics/Containers/ScalingContainer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public partial class ScalingContainer : Container
4040
private readonly Container content;
4141
protected override Container<Drawable> Content => content;
4242

43-
public override bool ReceivePositionalInputAt(System.Numerics.Vector2 screenSpacePos) => true;
43+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
4444

4545
private readonly Container sizableContainer;
4646

@@ -94,7 +94,7 @@ public partial class ScalingDrawSizePreservingFillContainer : DrawSizePreserving
9494

9595
protected float CurrentScale { get; private set; } = 1;
9696

97-
public override bool ReceivePositionalInputAt(System.Numerics.Vector2 screenSpacePos) => true;
97+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
9898

9999
public ScalingDrawSizePreservingFillContainer(bool applyUIScale)
100100
{
@@ -260,7 +260,7 @@ private partial class SizeableAlwaysInputContainer : Container
260260
private readonly bool confineHostCursor;
261261
private readonly LayoutValue cursorRectCache = new LayoutValue(Invalidation.RequiredParentSizeToFit);
262262

263-
public override bool ReceivePositionalInputAt(System.Numerics.Vector2 screenSpacePos) => true;
263+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
264264

265265
/// <summary>
266266
/// Container used for sizing/positioning purposes in <see cref="ScalingContainer"/>. Always receives mouse input.

osu.Game/Graphics/UserInterface/RoundedSliderBar.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using osu.Framework.Input.Events;
1313
using osu.Game.Overlays;
1414

15-
1615
namespace osu.Game.Graphics.UserInterface
1716
{
1817
public partial class RoundedSliderBar<T> : OsuSliderBar<T>

osu.Game/Graphics/UserInterface/ShearedRangeSlider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ protected virtual void UpdateDisplay(double value)
246246
NubText.Text = value.ToLocalisableString(@"N1");
247247
}
248248

249-
public override bool ReceivePositionalInputAt(System.Numerics.Vector2 screenSpacePos)
249+
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
250250
{
251251
if (isUpper)
252252
return base.ReceivePositionalInputAt(screenSpacePos) && screenSpacePos.X > rangeSlider.ScreenSpaceHalfwayPoint.X;

0 commit comments

Comments
 (0)