mirror of https://github.com/ppy/osu
Assert proportional scaling rather than assume average
Because if scaling is ever actually non-proportional then this should be somewhat loud. Also use the absolute value to prevent funny things happening if/when someone does negative scale.
This commit is contained in:
parent
75b9d0fe66
commit
115d82664b
|
@ -2,6 +2,7 @@
|
|||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
|
@ -13,6 +14,7 @@
|
|||
using osu.Framework.Graphics.Shaders.Types;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.OpenGL.Vertices;
|
||||
|
@ -151,9 +153,10 @@ public float GetSize()
|
|||
if (GetPlayfieldScale != null)
|
||||
{
|
||||
Vector2 playfieldScale = GetPlayfieldScale();
|
||||
float rulesetScaleAvg = (playfieldScale.X + playfieldScale.Y) / 2f;
|
||||
|
||||
size *= rulesetScaleAvg;
|
||||
Debug.Assert(Precision.AlmostEquals(Math.Abs(playfieldScale.X), Math.Abs(playfieldScale.Y)),
|
||||
@"Playfield has non-proportional scaling. Flashlight implementations should be revisited with regard to balance.");
|
||||
size *= Math.Abs(playfieldScale.X);
|
||||
}
|
||||
|
||||
if (isBreakTime.Value)
|
||||
|
|
Loading…
Reference in New Issue