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

Fix hidden notes due to 0 minimum width

This commit is contained in:
smoogipoo 2020-04-08 17:15:59 +09:00
parent 6575f589b4
commit 2ddea018cf
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,4 @@
[Mania]
Keys: 4
ColumnWidth: 10,10,10,10
WidthForNoteHeightScale: 0

View File

@ -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));
}
}
}
}

View File

@ -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;
}
}
}