summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/svg/qsvgtinydocument.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp
index a2bf1c7..56960bf 100644
--- a/src/svg/qsvgtinydocument.cpp
+++ b/src/svg/qsvgtinydocument.cpp
@@ -420,7 +420,9 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect,
source = viewBox();
if (source != target && !source.isNull()) {
- if (m_implicitViewBox) {
+ if (m_implicitViewBox || !sourceRect.isNull()) {
+ // Code path used when no view box is set, or when an explicit source size is given which
+ // overrides it (which is the case when we're rendering only a specific element by id).
QTransform transform;
transform.scale(target.width() / source.width(),
target.height() / source.height());