diff --git a/modules/gui/qt/util/color_svg_image_provider.cpp b/modules/gui/qt/util/color_svg_image_provider.cpp index 6d2fe1677dffdfce72d9cbd00a0c14fcb63f4a40..ce8edba37b45cade2047ddb2866bf5e0207f45f2 100644 --- a/modules/gui/qt/util/color_svg_image_provider.cpp +++ b/modules/gui/qt/util/color_svg_image_provider.cpp @@ -129,9 +129,15 @@ public: const QSize naturalSize = svgHandler->option(QImageIOHandler::Size).toSize(); if (m_requestedSize.width() == 0) + { scaledSize.setWidth(m_requestedSize.height() * ((qreal)naturalSize.width() / naturalSize.height())); + scaledSize.setHeight(m_requestedSize.height()); + } else if (m_requestedSize.height() == 0) + { scaledSize.setHeight(m_requestedSize.width() * ((qreal)naturalSize.height() / naturalSize.width())); + scaledSize.setWidth(m_requestedSize.width()); + } } else {