Gui: don't use cached value of color bar width if ratio of the canvas is less than 1.0

This commit is contained in:
wmayer
2022-06-07 11:30:00 +02:00
parent b4489422a5
commit 80bdc3f960

View File

@@ -87,7 +87,8 @@ void SoFCColorBarBase::setModified()
float SoFCColorBarBase::getBoundingWidth(const SbVec2s& size)
{
if (_boxWidth >= 0.0f) {
float fRatio = static_cast<float>(size[0]) / static_cast<float>(size[1]);
if (fRatio >= 1.0f && _boxWidth >= 0.0f) {
return _boxWidth;
}