From 80bdc3f9603e719375279140f927be5b2cd6ae5f Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 7 Jun 2022 11:30:00 +0200 Subject: [PATCH] Gui: don't use cached value of color bar width if ratio of the canvas is less than 1.0 --- src/Gui/SoFCColorBar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Gui/SoFCColorBar.cpp b/src/Gui/SoFCColorBar.cpp index 8061140314..34524c4d68 100644 --- a/src/Gui/SoFCColorBar.cpp +++ b/src/Gui/SoFCColorBar.cpp @@ -87,7 +87,8 @@ void SoFCColorBarBase::setModified() float SoFCColorBarBase::getBoundingWidth(const SbVec2s& size) { - if (_boxWidth >= 0.0f) { + float fRatio = static_cast(size[0]) / static_cast(size[1]); + if (fRatio >= 1.0f && _boxWidth >= 0.0f) { return _boxWidth; }