Round refresh rate instead of truncating

From upstream: 621ece63c8
This commit is contained in:
Kovid Goyal
2019-03-06 08:36:59 +05:30
parent 7e8e1e9e89
commit aa2b21456f
3 changed files with 6 additions and 3 deletions

View File

@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <IOKit/graphics/IOGraphicsLib.h>
#include <CoreVideo/CVBase.h>
@@ -148,7 +149,7 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
GLFWvidmode result;
result.width = (int) CGDisplayModeGetWidth(mode);
result.height = (int) CGDisplayModeGetHeight(mode);
result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode);
result.refreshRate = (int) round(CGDisplayModeGetRefreshRate(mode));
if (result.refreshRate == 0)
{