mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
Merge pull request #8677 from smoogipoo/fix-minwidth-override
Fix hidden notes due to 0 minimum width
This commit is contained in:
commit
9bdc881b3c
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,9 @@ namespace osu.Game.Skinning
|
||||
break;
|
||||
|
||||
case "WidthForNoteHeightScale":
|
||||
currentConfig.MinimumColumnWidth = float.Parse(pair.Value, CultureInfo.InvariantCulture) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
|
||||
float minWidth = float.Parse(pair.Value, CultureInfo.InvariantCulture) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
|
||||
if (minWidth > 0)
|
||||
currentConfig.MinimumColumnWidth = minWidth;
|
||||
break;
|
||||
|
||||
case string _ when pair.Key.StartsWith("Colour"):
|
||||
|
Loading…
Reference in New Issue
Block a user