From 1723196166fbf1817155fa260f275843eca21d32 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 30 May 2022 12:59:55 +0200 Subject: [PATCH] Gui: fix shrinking and shifting of color bar if ratio of width/height is smaller than one --- src/Gui/SoFCColorBar.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Gui/SoFCColorBar.cpp b/src/Gui/SoFCColorBar.cpp index 55b982fba5..a7f6c748cf 100644 --- a/src/Gui/SoFCColorBar.cpp +++ b/src/Gui/SoFCColorBar.cpp @@ -119,17 +119,15 @@ float SoFCColorBarBase::getBounds(const SbVec2s& size, float& fMinX, float&fMinY fMaxY = baseYValue; // bar has the height of almost whole window height if (fRatio < 1.0f) { - // must be adjusted to assure that the height of the bar doesn't shrink + // must be adjusted to assure that the size of the bar doesn't shrink + fMinX /= fRatio; + fMaxX /= fRatio; fMinY = -baseYValue / fRatio; fMaxY = baseYValue / fRatio; } // get the bounding box width of the color bar and labels float boxWidth = getBoundingWidth(size); - if (fRatio < 1.0f) { - boxWidth *= fRatio; - } - return boxWidth; }