mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 20:57:28 +09:00
Prevent feedback by using atomic .ReplaceRange()
`display.NewValue` will never be null, checked on SDL + osuTK/Android. On Android it's a 0x0 display, importantly not null.
This commit is contained in:
parent
732bd7812b
commit
2d7fe68311
@ -193,16 +193,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
|
|
||||||
currentDisplay.BindValueChanged(display => Schedule(() =>
|
currentDisplay.BindValueChanged(display => Schedule(() =>
|
||||||
{
|
{
|
||||||
resolutions.RemoveRange(1, resolutions.Count - 1);
|
resolutions.ReplaceRange(1, resolutions.Count - 1, display.NewValue.DisplayModes
|
||||||
|
.Where(m => m.Size.Width >= 800 && m.Size.Height >= 600)
|
||||||
if (display.NewValue != null)
|
.OrderByDescending(m => Math.Max(m.Size.Height, m.Size.Width))
|
||||||
{
|
.Select(m => m.Size)
|
||||||
resolutions.AddRange(display.NewValue.DisplayModes
|
.Distinct());
|
||||||
.Where(m => m.Size.Width >= 800 && m.Size.Height >= 600)
|
|
||||||
.OrderByDescending(m => Math.Max(m.Size.Height, m.Size.Width))
|
|
||||||
.Select(m => m.Size)
|
|
||||||
.Distinct());
|
|
||||||
}
|
|
||||||
|
|
||||||
updateDisplaySettingsVisibility();
|
updateDisplaySettingsVisibility();
|
||||||
}), true);
|
}), true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user