1
0
mirror of synced 2025-01-10 21:41:53 +01:00

fix: Make sure WM_NCCALCSIZE never tries to sleep a negative amount of time

#1842
This commit is contained in:
WerWolv 2024-12-31 18:06:31 +01:00
parent 3dec4cc698
commit ee555e0da9

View File

@ -206,13 +206,14 @@ namespace hex {
if (delta >= 0) {
sleepTicks = delta / period;
} else {
sleepTicks = -1 + delta / period;
}
sleepMilliSeconds = delta - (period * sleepTicks);
const double sleepTime = (1000.0 * double(sleepMilliSeconds) / double(performanceFrequency.QuadPart));
Sleep(DWORD(std::round(sleepTime)));
const double sleepTime = std::round(1000.0 * double(sleepMilliSeconds) / double(performanceFrequency.QuadPart));
if (sleepTime >= 0.0) {
Sleep(DWORD(sleepTime));
}
timeEndPeriod(granularity);
return WVR_REDRAW;