[vlc-devel] [PATCH 2/2] contrib: qtsvg: provide support for fractional scaling

Pierre Lamot pierre at videolabs.io
Tue Feb 20 17:58:50 CET 2018


---
 ...ine-Paint-correct-size-if-device-pixel-ra.patch | 30 ++++++++++++++++++++++
 contrib/src/qtsvg/rules.mak                        |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 contrib/src/qtsvg/0002-QSvgIconEngine-Paint-correct-size-if-device-pixel-ra.patch

diff --git a/contrib/src/qtsvg/0002-QSvgIconEngine-Paint-correct-size-if-device-pixel-ra.patch b/contrib/src/qtsvg/0002-QSvgIconEngine-Paint-correct-size-if-device-pixel-ra.patch
new file mode 100644
index 0000000000..ec1b38941b
--- /dev/null
+++ b/contrib/src/qtsvg/0002-QSvgIconEngine-Paint-correct-size-if-device-pixel-ra.patch
@@ -0,0 +1,30 @@
+From 02ed4c65618b0f27b9ccb6867ab4d633612415c8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16 at wp.pl>
+Date: Sun, 26 Mar 2017 13:55:23 +0200
+Subject: [PATCH] QSvgIconEngine: Paint correct size if device pixel ratio is
+ fractional
+
+Use method which returns qreal. It is available since Qt 5.6.
+
+Task-number: QTBUG-59729
+Change-Id: Ifc1a101c8dd837597c35ce14f0314218d2882501
+Reviewed-by: Friedemann Kleint <Friedemann.Kleint at qt.io>
+---
+ src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
+index 53e9a57..2644326 100644
+--- a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
++++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
+@@ -227,7 +227,7 @@ void QSvgIconEngine::paint(QPainter *painter, const QRect &rect,
+ {
+     QSize pixmapSize = rect.size();
+     if (painter->device())
+-        pixmapSize *= painter->device()->devicePixelRatio();
++        pixmapSize *= painter->device()->devicePixelRatioF();
+     painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
+ }
+
+--
+2.14.1
diff --git a/contrib/src/qtsvg/rules.mak b/contrib/src/qtsvg/rules.mak
index 0d8d8b797b..ca34081958 100644
--- a/contrib/src/qtsvg/rules.mak
+++ b/contrib/src/qtsvg/rules.mak
@@ -22,6 +22,7 @@ qtsvg: qtsvg-$(QTSVG_VERSION).tar.xz .sum-qtsvg
 	$(UNPACK)
 	mv qtsvg-opensource-src-$(QTSVG_VERSION) qtsvg-$(QTSVG_VERSION)
 	$(APPLY) $(SRC)/qtsvg/0001-Force-the-usage-of-QtZlib-header.patch
+	$(APPLY) $(SRC)/qtsvg/0002-QSvgIconEngine-Paint-correct-size-if-device-pixel-ra.patch
 	$(MOVE)
 
 .qtsvg: qtsvg
-- 
2.14.1



More information about the vlc-devel mailing list