From e7c2cd0eba1a46a6168c6f2cf6d7ac3132a64614 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 2 Feb 2023 18:44:08 +0100 Subject: [PATCH] QskBoxShapeMetrics::toAbsolute reverted for the moment as the scaling of the buttons is broken now. Only a temporary workaround as the other implementation was actually correct --- src/common/QskBoxShapeMetrics.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/common/QskBoxShapeMetrics.cpp b/src/common/QskBoxShapeMetrics.cpp index 926ff414..e1528c06 100644 --- a/src/common/QskBoxShapeMetrics.cpp +++ b/src/common/QskBoxShapeMetrics.cpp @@ -113,6 +113,7 @@ QskBoxShapeMetrics QskBoxShapeMetrics::toAbsolute( const QSizeF& size ) const no { if ( m_aspectRatioMode != Qt::IgnoreAspectRatio ) { +#if 0 if ( ( m_aspectRatioMode == Qt::KeepAspectRatioByExpanding ) && ( radius.width() >= radius.height() ) ) { @@ -122,8 +123,20 @@ QskBoxShapeMetrics QskBoxShapeMetrics::toAbsolute( const QSizeF& size ) const no { ry = rx * radius.height() / radius.width(); } - } +#else + if ( m_aspectRatioMode == Qt::KeepAspectRatio ) + { + rx = std::min( rx, ry ); + ry = std::min( rx, ry ); + } + else + { + rx = std::max( rx, ry ); + ry = std::max( rx, ry ); + } +#endif + } radius.rwidth() = rx; radius.rheight() = ry; }