From bbe8f65cd070ab85a5e7cd31548e5fef3f7f53e3 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Thu, 9 Jan 2020 10:28:06 +0200 Subject: Add changes file for Qt 5.14.1 + f851e3213c8afac49f31a1506597e7f6783ee8c9 Add binary compatibility file for qtsvg 5.14 branch + 2eba1572ee49c22f4734b1fb80aa8023d60a8e70 Bump version + acb66cad2280bda20d26d08d606a66b9660b17aa Fix yet another viewbox scaling issue, for render to bounds Change-Id: I89b2a175cfa305eb54541b00e5bfeed16b5fe114 Reviewed-by: Jani Heikkinen --- dist/changes-5.14.1 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dist/changes-5.14.1 diff --git a/dist/changes-5.14.1 b/dist/changes-5.14.1 new file mode 100644 index 0000000..3aac480 --- /dev/null +++ b/dist/changes-5.14.1 @@ -0,0 +1,28 @@ +Qt 5.14.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.14.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.14 series is binary compatible with the 5.13.x series. +Applications compiled for 5.13 will continue to run with 5.14. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* QSVGRenderer * +**************************************************************************** + + - From Qt 5.14.0, normal rendering will keep aspect ratio implied by the + viewbox. The render() methods taking an explicit target bounds QRectF + parameter can now be used to override that behavior. They will scale the + output to the bounds while ignoring aspect ratio, as was the default + rendering prior to 5.14.0. -- cgit v1.2.1 From 9b8eba6731b524a300a72974cd5484f06abc4cf0 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 16 Jan 2020 10:35:21 +0100 Subject: Fix changes file according to latest change https://codereview.qt-project.org/c/qt/qtsvg/+/286086 Change-Id: I085a4515eb80bae80e551cf976900f100132483a Reviewed-by: Simon Hausmann --- dist/changes-5.14.1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/changes-5.14.1 b/dist/changes-5.14.1 index 3aac480..093098c 100644 --- a/dist/changes-5.14.1 +++ b/dist/changes-5.14.1 @@ -21,8 +21,8 @@ information about a particular change. * QSVGRenderer * **************************************************************************** - - From Qt 5.14.0, normal rendering will keep aspect ratio implied by the - viewbox. The render() methods taking an explicit target bounds QRectF - parameter can now be used to override that behavior. They will scale the - output to the bounds while ignoring aspect ratio, as was the default - rendering prior to 5.14.0. + - In Qt 5.14.0, rendering would keep aspect ratio implied by the + viewbox, independently of the specified target area. This caused + many regressions with existing code, so is reverted now in + 5.14.1. The feature will instead be available as an opt-in in Qt + 5.15. -- cgit v1.2.1 From 3e2823a147b2dca492fece187facfe39f4d33bed Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 9 Jan 2020 11:03:44 +0100 Subject: Revert the keep-aspectratio feature for 5.14.1 This was introduced as non-optional behavior for 5.14.0, but caused many regressions. This patch reverts that, and instead prepares for introducing it as an opt-in feature in Qt 5.15. [ChangeLog][QSVGRenderer] In Qt 5.14.0, rendering would keep aspect ratio implied by the viewbox, independently of the specified target area. This caused many regressions with existing code, so is reverted now in 5.14.1. The feature will instead be available as an opt-in in Qt 5.15. Task-number: QTBUG-81259 Change-Id: I3efa2db864eb80ee00e8a067e56d9912bab36442 Reviewed-by: Eirik Aavitsland --- src/svg/qsvgtinydocument.cpp | 15 ++++++++------- tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 3 +++ 2 files changed, 11 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 - // tag that's implicitly defined when is used. + // Code path used when KeepAspectRatio is requested. This attempts to emulate the default values + // of the 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 } } diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp index 8ad74f2..ca05a3a 100644 --- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp @@ -270,6 +270,8 @@ void tst_QSvgRenderer::testMapViewBoxToTarget() QCOMPARE(picture.boundingRect(), QRect(125, 125, 250, 250)); } +#if 0 + // Requires keep-aspectratio feature { // Viewport and viewBox specified -> scale 500x500 square to 1000x750 while preserving aspect ratio gives 750x750 data = ""; QPicture picture; @@ -279,6 +281,7 @@ void tst_QSvgRenderer::testMapViewBoxToTarget() painter.end(); QCOMPARE(picture.boundingRect(), QRect(500, 375, 750, 750)); } +#endif } void tst_QSvgRenderer::testRenderElement() -- cgit v1.2.1