diff options
Diffstat (limited to 'src/svg/qsvgtinydocument.cpp')
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index 3143ad2..7e35508 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -434,10 +434,6 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, // but the entire document. This attempts to emulate the default values of the <preserveAspectRatio> // tag that's implicitly defined when <viewbox> is used. - // Apply the view box translation if specified. - p->translate(target.x() - source.x(), - target.y() - source.y()); - // Scale the view box into the view port (target) by preserve the aspect ratio. QSizeF viewBoxSize = source.size(); viewBoxSize.scale(target.width(), target.height(), Qt::KeepAspectRatio); @@ -448,6 +444,10 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, p->scale(viewBoxSize.width() / source.width(), viewBoxSize.height() / source.height()); + + // Apply the view box translation if specified. + p->translate(target.x() - source.x(), + target.y() - source.y()); } } } |