diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-27 14:13:46 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-27 14:13:46 +0100 |
commit | 89045a973568a5750670db7340f2f58d478f78d0 (patch) | |
tree | ce50e028742a13cad4e5487d56e0824cf793c3d3 /src | |
parent | acb66cad2280bda20d26d08d606a66b9660b17aa (diff) | |
parent | 3e2823a147b2dca492fece187facfe39f4d33bed (diff) | |
download | qtsvg-89045a973568a5750670db7340f2f58d478f78d0.tar.gz |
Merge remote-tracking branch 'origin/5.14.1' into 5.14
Change-Id: Id0d3c97d6b5120c5386704e80fccef8b0242f000
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index 173baaa..0877e41 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -420,10 +420,10 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, source = viewBox(); if (source != target && !source.isNull()) { - if (m_implicitViewBox || !sourceRect.isNull() || !targetRect.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), - // or when user has given explicit target bounds that overrides viebox aspect ratio +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if (m_implicitViewBox || !preserveAspectRatio()) { + // Code path used when no view box is set, or IgnoreAspectRatio requested +#endif QTransform transform; transform.scale(target.width() / source.width(), target.height() / source.height()); @@ -432,10 +432,10 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, target.y() - c2.y()); p->scale(target.width() / source.width(), target.height() / source.height()); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) } else { - // Code path used when a view box is specified and we're not rendering a specific element by id - // but the entire document. This attempts to emulate the default values of the <preserveAspectRatio> - // tag that's implicitly defined when <viewbox> is used. + // Code path used when KeepAspectRatio is requested. This attempts to emulate the default values + // of the <preserveAspectRatio tag that's implicitly defined when <viewbox> is used. // Scale the view box into the view port (target) by preserve the aspect ratio. QSizeF viewBoxSize = source.size(); @@ -451,6 +451,7 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, // Apply the view box translation if specified. p->translate(-source.x(), -source.y()); } +#endif } } |