We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a50ff7 commit f13c240Copy full SHA for f13c240
1 file changed
source/editor/Widgets/RenderOptions.cpp
@@ -207,10 +207,11 @@ void RenderOptions::OnVisible()
207
{
208
display_modes.clear();
209
display_modes_string.clear();
210
-
211
for (const DisplayMode& display_mode : Display::GetDisplayModes())
212
213
- if (display_mode.hz == Display::GetRefreshRate())
+ // only include resolutions that match the monitor's current refresh rate (with tolerance for floating-point quirks like 240 vs 239.8 Hz)
+ // quirks like that can exist for NVIDIA for example, but not for AMD, so it's important to be safe like that
214
+ if (fabs(display_mode.hz - Display::GetRefreshRate()) < 0.1f)
215
216
display_modes.emplace_back(display_mode);
217
display_modes_string.emplace_back(to_string(display_mode.width) + "x" + to_string(display_mode.height));
0 commit comments