mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:45:09 +08:00
Fix hidden notes due to 0 minimum width
This commit is contained in:
parent
6575f589b4
commit
2ddea018cf
4
osu.Game.Tests/Resources/mania-skin-zero-minwidth.ini
Normal file
4
osu.Game.Tests/Resources/mania-skin-zero-minwidth.ini
Normal file
@ -0,0 +1,4 @@
|
||||
[Mania]
|
||||
Keys: 4
|
||||
ColumnWidth: 10,10,10,10
|
||||
WidthForNoteHeightScale: 0
|
@ -99,5 +99,20 @@ namespace osu.Game.Tests.Skins
|
||||
Assert.That(configs[0].CustomColours, Contains.Key("ColourBarline").And.ContainValue(new Color4(50, 50, 50, 50)));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMinimumColumnWidthFallsBackWhenZeroIsProvided()
|
||||
{
|
||||
var decoder = new LegacyManiaSkinDecoder();
|
||||
|
||||
using (var resStream = TestResources.OpenResource("mania-skin-zero-minwidth.ini"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var configs = decoder.Decode(stream);
|
||||
|
||||
Assert.That(configs.Count, Is.EqualTo(1));
|
||||
Assert.That(configs[0].MinimumColumnWidth, Is.EqualTo(16));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Skinning
|
||||
public float MinimumColumnWidth
|
||||
{
|
||||
get => minimumColumnWidth ?? ColumnWidth.Min();
|
||||
set => minimumColumnWidth = value;
|
||||
set => minimumColumnWidth = value > 0 ? (float?)value : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user