Use condition instead of assertion #5030
This commit is contained in:
parent
ebec92fd5b
commit
4f1f2dcff0
|
@ -39,8 +39,7 @@ void DpiHelper::calculateDpi(size_t width, size_t height)
|
||||||
size_t dpiTest1 = s_resolutionWidth * 100 / width;
|
size_t dpiTest1 = s_resolutionWidth * 100 / width;
|
||||||
size_t dpiTest2 = s_resolutionHeight * 100 / height;
|
size_t dpiTest2 = s_resolutionHeight * 100 / height;
|
||||||
|
|
||||||
assert(dpiTest1 == dpiTest2);
|
if (dpiTest1 == dpiTest2) {
|
||||||
|
|
||||||
s_dpi = dpiTest1;
|
s_dpi = dpiTest1;
|
||||||
|
|
||||||
if (s_dpi != kDefaultDpi) {
|
if (s_dpi != kDefaultDpi) {
|
||||||
|
@ -50,3 +49,4 @@ void DpiHelper::calculateDpi(size_t width, size_t height)
|
||||||
LOG((CLOG_DEBUG "physical resolution: %d, %d scaled resolution: %d, %d", s_resolutionWidth, s_resolutionHeight, width, height));
|
LOG((CLOG_DEBUG "physical resolution: %d, %d scaled resolution: %d, %d", s_resolutionWidth, s_resolutionHeight, width, height));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue