UI: Only apply new scaling behavior on newer installs

The new scaling behavior affects defaults, so only apply it to new
installs of 26.2 or greater, while maintaining the previous behavior if
the user is upgrading from an older version.
This commit is contained in:
jp9000 committed 2020-12-29 08:58:30 -08:00
1 parent 5cdd084c7f
commit 4e5f20dcbe
2 files changed
+22 -4

No files matched your search

+10 -4
View File
@@ -1218,13 +1218,19 @@ bool OBSBasic::InitBasicConfigDefaults()
uint32_t cx = primaryScreen->size().width();
uint32_t cy = primaryScreen->size().height();
bool oldScaleBehavior = config_get_bool(App()->GlobalConfig(),
"General", "Pre26.2Defaults");
/* after version 26.2, apply scaling to cx/cy */
if (!oldScaleBehavior) {
#ifdef SUPPORTS_FRACTIONAL_SCALING
cx *= devicePixelRatioF();
cy *= devicePixelRatioF();
cx *= devicePixelRatioF();
cy *= devicePixelRatioF();
#elif
cx *= devicePixelRatio();
cy *= devicePixelRatio();
cx *= devicePixelRatio();
cy *= devicePixelRatio();
#endif
}
bool oldResolutionDefaults = config_get_bool(
App()->GlobalConfig(), "General", "Pre19Defaults");