From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AEAA213838E for ; Thu, 16 Jan 2020 16:07:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BC10AE0920; Thu, 16 Jan 2020 16:07:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 72369E0920 for ; Thu, 16 Jan 2020 16:07:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0051034E13A for ; Thu, 16 Jan 2020 16:07:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E77C537 for ; Thu, 16 Jan 2020 16:06:58 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1579190808.c87989bb5ff982772175581acf7eb874a901cc10.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtsvg/files/, dev-qt/qtsvg/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-qt/qtsvg/files/qtsvg-5.14.0-revert-keep-aspectratio.patch dev-qt/qtsvg/qtsvg-5.14.0-r1.ebuild X-VCS-Directories: dev-qt/qtsvg/files/ dev-qt/qtsvg/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: c87989bb5ff982772175581acf7eb874a901cc10 X-VCS-Branch: master Date: Thu, 16 Jan 2020 16:06:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8d01a349-b654-46a0-8370-d6587abe32be X-Archives-Hash: 3c3114040313292199f84fd63e4a15ac commit: c87989bb5ff982772175581acf7eb874a901cc10 Author: Andreas Sturmlechner gentoo org> AuthorDate: Thu Jan 16 16:02:00 2020 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Thu Jan 16 16:06:48 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c87989bb dev-qt/qtsvg: Revert the keep-aspectratio feature (from 5.14.1) Requested-by: Lars Wendler gentoo.org> Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Andreas Sturmlechner gentoo.org> .../qtsvg-5.14.0-revert-keep-aspectratio.patch | 85 ++++++++++++++++++++++ dev-qt/qtsvg/qtsvg-5.14.0-r1.ebuild | 25 +++++++ 2 files changed, 110 insertions(+) diff --git a/dev-qt/qtsvg/files/qtsvg-5.14.0-revert-keep-aspectratio.patch b/dev-qt/qtsvg/files/qtsvg-5.14.0-revert-keep-aspectratio.patch new file mode 100644 index 00000000000..589492ca6ba --- /dev/null +++ b/dev-qt/qtsvg/files/qtsvg-5.14.0-revert-keep-aspectratio.patch @@ -0,0 +1,85 @@ +From 51694a5e293ae4eb7b83167e7cb54822907eb594 Mon Sep 17 00:00:00 2001 +From: Eirik Aavitsland +Date: Thu, 9 Jan 2020 11:03:44 +0100 +Subject: [PATCH] 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 +--- + src/svg/qsvgtinydocument.cpp | 14 ++++++++------ + tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 3 +++ + 2 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp +index 56960bf..b364634 100644 +--- a/src/svg/qsvgtinydocument.cpp ++++ b/src/svg/qsvgtinydocument.cpp +@@ -420,9 +420,10 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, + source = viewBox(); + + if (source != target && !source.isNull()) { +- 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). ++#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()); +@@ -431,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 +452,7 @@ void QSvgTinyDocument::mapSourceToTarget(QPainter *p, const QRectF &targetRect, + p->translate(target.x() - source.x(), + target.y() - source.y()); + } ++#endif + } + } + +diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +index 309c646..43a3eb8 100644 +--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp ++++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +@@ -269,6 +269,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; +@@ -278,6 +280,7 @@ void tst_QSvgRenderer::testMapViewBoxToTarget() + painter.end(); + QCOMPARE(picture.boundingRect(), QRect(500, 375, 750, 750)); + } ++#endif + } + + void tst_QSvgRenderer::testRenderElement() +-- +2.25.0 diff --git a/dev-qt/qtsvg/qtsvg-5.14.0-r1.ebuild b/dev-qt/qtsvg/qtsvg-5.14.0-r1.ebuild new file mode 100644 index 00000000000..4716b5e4790 --- /dev/null +++ b/dev-qt/qtsvg/qtsvg-5.14.0-r1.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit qt5-build + +DESCRIPTION="SVG rendering library for the Qt5 framework" + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +fi + +IUSE="" + +RDEPEND=" + ~dev-qt/qtcore-${PV} + ~dev-qt/qtgui-${PV} + ~dev-qt/qtwidgets-${PV} + sys-libs/zlib:= +" +DEPEND="${RDEPEND} + test? ( ~dev-qt/qtxml-${PV} ) +" + +PATCHES=( "${FILESDIR}/${P}-revert-keep-aspectratio.patch" ) # QTBUG-81259