浏览代码

DisplayManagerWin: fix ridiculously stupid mistake

And it's completely my own fault.

This was meant to be 1e-9 (0.000000001), but it was accidentally written
as 1e9 (1000000000), which makes the check always true, and which will
make almost always pick a mode with the wrong refresh rate.

This also explains why the refresh rate was frequently incorrect, while
all other parameters like screen size were correct.

Pointed out by a friendly forum user.
Vincent Lang 9 年之前
父节点
当前提交
91db17bc1a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/display/win/DisplayManagerWin.cpp

+ 1 - 1
src/display/win/DisplayManagerWin.cpp

@@ -36,7 +36,7 @@ static bool modeEquals(const DMVideoMode& m1, const DMVideoMode& m2)
 {
   return m1.height == m2.height &&
          m1.width == m2.width &&
-         fabs(m1.refreshRate - m2.refreshRate) < 1e9 &&
+         fabs(m1.refreshRate - m2.refreshRate) < 1e-9 &&
          m1.bitsPerPixel == m2.bitsPerPixel &&
          m1.interlaced == m2.interlaced;
 }