Gui: fix shrinking and shifting of color bar if ratio of width/height is smaller than one

This commit is contained in:
wmayer
2022-05-30 12:59:55 +02:00
parent 683c9ac65c
commit e0d497643b

View File

@@ -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;
}