summaryrefslogtreecommitdiffstats
path: root/meta/recipes-qt
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2013-10-24 21:39:52 +1100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-12 17:00:06 +0000
commit2421773925812efb0f80f89aac3acdecda1f1c3b (patch)
tree7266b8807203f84f89c1d9658998e2a062a43c02 /meta/recipes-qt
parent7d675f1967d76904124fbe46a2b7636c300ec73e (diff)
downloadpoky-2421773925812efb0f80f89aac3acdecda1f1c3b.tar.gz
qt4: add upstream QTBUG-34218/QTBUG-34234 misaligned selection patch
(From OE-Core master rev: 3af8f2e0697a9523d3b505ba4c48eca35f6de3a9) (From OE-Core rev: 438032411ea5d71a33b7b030752193867a90b9f7) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-qt')
-rw-r--r--meta/recipes-qt/qt4/qt4-4.8.5.inc1
-rw-r--r--meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch75
2 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5.inc b/meta/recipes-qt/qt4/qt4-4.8.5.inc
index 99359927cb..dcbf26ff12 100644
--- a/meta/recipes-qt/qt4/qt4-4.8.5.inc
+++ b/meta/recipes-qt/qt4/qt4-4.8.5.inc
@@ -24,6 +24,7 @@ SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-ever
24 file://0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch \ 24 file://0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch \
25 file://0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch \ 25 file://0023-QHttpMultiPart-fix-data-corruption-in-readData-metho.patch \
26 file://0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch \ 26 file://0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch \
27 file://0025-Fix-misaligned-selection-region-with-text-when-cente.patch \
27 file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \ 28 file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \
28 file://g++.conf \ 29 file://g++.conf \
29 file://linux.conf \ 30 file://linux.conf \
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch
new file mode 100644
index 0000000000..964bcf8efb
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.5/0025-Fix-misaligned-selection-region-with-text-when-cente.patch
@@ -0,0 +1,75 @@
1From c368cbad3a505d44894ff150dc25c74d0174ca15 Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Wed, 23 Oct 2013 00:28:17 +1100
4Subject: [PATCH] Fix misaligned selection region with text when centered
5
6If the text is centered, the x/y position in the selection QRectF may
7be a multiple of 0.5 which is rounded up. This rounding causes
8misalignment of the selection region with the text.
9
10The alignment is fixed by using qFloor on the x and y components.
11
12Upstream-Status: Accepted [https://codereview.qt-project.org/#change,68935]
13Signed-off-by: Jonathan Liu <net147@gmail.com>
14
15Task-number: QTBUG-34218
16Task-number: QTBUG-34234
17Change-Id: I4f2fadeb38602f62a93773c6e5faecf03b28069f
18Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
19(cherry picked from qtbase/5d8a882c11201a29475c5ea71cfb76c9de6573f5)
20---
21 src/gui/text/qtextlayout.cpp | 19 ++++++++++++++-----
22 1 file changed, 14 insertions(+), 5 deletions(-)
23
24diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
25index 3d340cb..8d652ea 100644
26--- a/src/gui/text/qtextlayout.cpp
27+++ b/src/gui/text/qtextlayout.cpp
28@@ -44,6 +44,7 @@
29
30 #include <qfont.h>
31 #include <qapplication.h>
32+#include <qmath.h>
33 #include <qpainter.h>
34 #include <qvarlengtharray.h>
35 #include <qtextformat.h>
36@@ -979,15 +980,23 @@ static void addSelectedRegionsToPath(QTextEngine *eng, int lineNumber, const QPo
37 continue;
38 }
39
40- if (lastSelectionWidth > 0)
41- region->addRect(boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight));
42+ if (lastSelectionWidth > 0) {
43+ QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight);
44+ rect.moveLeft(qFloor(rect.left()));
45+ rect.moveTop(qFloor(rect.top()));
46+ region->addRect(rect);
47+ }
48
49 lastSelectionX = selectionX;
50 lastSelectionWidth = selectionWidth;
51 }
52 }
53- if (lastSelectionWidth > 0)
54- region->addRect(boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight));
55+ if (lastSelectionWidth > 0) {
56+ QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight);
57+ rect.moveLeft(qFloor(rect.left()));
58+ rect.moveTop(qFloor(rect.top()));
59+ region->addRect(rect);
60+ }
61 }
62
63 static inline QRectF clipIfValid(const QRectF &rect, const QRectF &clip)
64@@ -2081,7 +2090,7 @@ static void setPenAndDrawBackground(QPainter *p, const QPen &defaultPen, const Q
65
66 QBrush bg = chf.background();
67 if (bg.style() != Qt::NoBrush && !chf.property(SuppressBackground).toBool())
68- p->fillRect(r, bg);
69+ p->fillRect(QRectF(qFloor(r.x()), qFloor(r.y()), r.width(), r.height()), bg);
70 if (c.style() != Qt::NoBrush) {
71 p->setPen(QPen(c, 0));
72 }
73--
741.8.4
75