mirror of
https://github.com/ppy/osu
synced 2024-12-29 10:22:43 +00: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(() =>
|
||||
{
|
||||
resolutions.RemoveRange(1, resolutions.Count - 1);
|
||||
|
||||
if (display.NewValue != null)
|
||||
{
|
||||
resolutions.AddRange(display.NewValue.DisplayModes
|
||||
.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());
|
||||
}
|
||||
resolutions.ReplaceRange(1, resolutions.Count - 1, display.NewValue.DisplayModes
|
||||
.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();
|
||||
}), true);
|
||||
|
Loading…
Reference in New Issue
Block a user