Signed-off-by: falkTX <falktx@falktx.com>pull/452/head
@@ -280,10 +280,10 @@ public: | |||||
double scaleFactor = fScaleFactor; | double scaleFactor = fScaleFactor; | ||||
#if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT) | #if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT) | ||||
*width = DISTRHO_UI_DEFAULT_WIDTH; | |||||
*height = DISTRHO_UI_DEFAULT_HEIGHT; | |||||
if (d_isZero(scaleFactor)) | if (d_isZero(scaleFactor)) | ||||
scaleFactor = 1.0; | scaleFactor = 1.0; | ||||
*width = DISTRHO_UI_DEFAULT_WIDTH * scaleFactor; | |||||
*height = DISTRHO_UI_DEFAULT_HEIGHT * scaleFactor; | |||||
#else | #else | ||||
UIExporter tmpUI(nullptr, 0, fPlugin.getSampleRate(), | UIExporter tmpUI(nullptr, 0, fPlugin.getSampleRate(), | ||||
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath, | nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath, | ||||
@@ -371,10 +371,10 @@ public: | |||||
{ | { | ||||
// fix width | // fix width | ||||
if (reqRatio > ratio) | if (reqRatio > ratio) | ||||
*width = static_cast<int32_t>(*height * ratio + 0.5); | |||||
*width = d_roundToIntPositive(*height * ratio); | |||||
// fix height | // fix height | ||||
else | else | ||||
*height = static_cast<int32_t>(static_cast<double>(*width) / ratio + 0.5); | |||||
*height = d_roundToIntPositive(static_cast<double>(*width) / ratio); | |||||
} | } | ||||
} | } | ||||
@@ -602,10 +602,10 @@ public: | |||||
{ | { | ||||
double scaleFactor = fLastScaleFactor; | double scaleFactor = fLastScaleFactor; | ||||
#if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT) | #if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT) | ||||
fVstRect.right = DISTRHO_UI_DEFAULT_WIDTH; | |||||
fVstRect.bottom = DISTRHO_UI_DEFAULT_HEIGHT; | |||||
if (d_isZero(scaleFactor)) | if (d_isZero(scaleFactor)) | ||||
scaleFactor = 1.0; | scaleFactor = 1.0; | ||||
fVstRect.right = DISTRHO_UI_DEFAULT_WIDTH * scaleFactor; | |||||
fVstRect.bottom = DISTRHO_UI_DEFAULT_HEIGHT * scaleFactor; | |||||
#else | #else | ||||
UIExporter tmpUI(nullptr, 0, fPlugin.getSampleRate(), | UIExporter tmpUI(nullptr, 0, fPlugin.getSampleRate(), | ||||
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath, | nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath, | ||||
@@ -92,10 +92,10 @@ static void applyGeometryConstraints(const uint minimumWidth, | |||||
{ | { | ||||
// fix width | // fix width | ||||
if (reqRatio > ratio) | if (reqRatio > ratio) | ||||
rect->right = static_cast<int32_t>(rect->bottom * ratio + 0.5); | |||||
rect->right = d_roundToIntPositive(rect->bottom * ratio); | |||||
// fix height | // fix height | ||||
else | else | ||||
rect->bottom = static_cast<int32_t>(static_cast<double>(rect->right) / ratio + 0.5); | |||||
rect->bottom = d_roundToIntPositive(static_cast<double>(rect->right) / ratio); | |||||
} | } | ||||
} | } | ||||
@@ -1527,10 +1527,10 @@ struct dpf_plugin_view : v3_plugin_view_cpp { | |||||
double scaleFactor = view->scale != nullptr ? view->scale->scaleFactor : 0.0; | double scaleFactor = view->scale != nullptr ? view->scale->scaleFactor : 0.0; | ||||
#if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT) | #if defined(DISTRHO_UI_DEFAULT_WIDTH) && defined(DISTRHO_UI_DEFAULT_HEIGHT) | ||||
rect->right = DISTRHO_UI_DEFAULT_WIDTH; | |||||
rect->bottom = DISTRHO_UI_DEFAULT_HEIGHT; | |||||
if (d_isZero(scaleFactor)) | if (d_isZero(scaleFactor)) | ||||
scaleFactor = 1.0; | scaleFactor = 1.0; | ||||
rect->right = DISTRHO_UI_DEFAULT_WIDTH * scaleFactor; | |||||
rect->bottom = DISTRHO_UI_DEFAULT_HEIGHT * scaleFactor; | |||||
#else | #else | ||||
UIExporter tmpUI(nullptr, 0, view->sampleRate, | UIExporter tmpUI(nullptr, 0, view->sampleRate, | ||||
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath, | nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, d_nextBundlePath, | ||||
@@ -1540,6 +1540,7 @@ struct dpf_plugin_view : v3_plugin_view_cpp { | |||||
scaleFactor = tmpUI.getScaleFactor(); | scaleFactor = tmpUI.getScaleFactor(); | ||||
tmpUI.quit(); | tmpUI.quit(); | ||||
#endif | #endif | ||||
rect->left = rect->top = 0; | rect->left = rect->top = 0; | ||||
#ifdef DISTRHO_OS_MAC | #ifdef DISTRHO_OS_MAC | ||||
rect->right /= scaleFactor; | rect->right /= scaleFactor; | ||||