backported patch to fix selection rendering issues if rounding leads to left-out pixels

This commit is contained in:
Than Ngo 2018-10-25 11:02:47 +02:00
parent 8ed6ce04af
commit 4a376dc703
2 changed files with 44 additions and 1 deletions

View File

@ -46,7 +46,7 @@ BuildRequires: pkgconfig(libsystemd)
Name: qt5-qtbase
Summary: Qt5 - QtBase components
Version: 5.11.2
Release: 2%{?dist}
Release: 3%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -119,6 +119,7 @@ Patch68: qtbase-everywhere-src-5.11.1-python3.patch
Patch69: qt5-qtbase-glibc.patch
## upstream patches
Patch500: qtbase-everywhere-src-5.11.2-rendering-issue.patch
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
# Those themes are there for platform integration. If the required libraries are
@ -376,6 +377,7 @@ Qt5 libraries used for drawing widgets and OpenGL items.
%endif
## upstream patches
%patch500 -p1 -b .rendering-issue
# move some bundled libs to ensure they're not accidentally used
pushd src/3rdparty
@ -984,6 +986,9 @@ fi
%changelog
* Thu Oct 25 2018 Than Ngo <than@redhat.com> - 5.11.2-3
- backported patch to fix selection rendering issues if rounding leads to left-out pixels
* Thu Oct 11 2018 Rex Dieter <rdieter@fedoraproject.org> - 5.11.2-2
- -no-use-gold-linker (#1635973)

View File

@ -0,0 +1,38 @@
diff -up qtbase-everywhere-src-5.11.2/src/gui/text/qtextlayout.cpp.me qtbase-everywhere-src-5.11.2/src/gui/text/qtextlayout.cpp
--- qtbase-everywhere-src-5.11.2/src/gui/text/qtextlayout.cpp.me 2018-10-25 10:54:48.849646288 +0200
+++ qtbase-everywhere-src-5.11.2/src/gui/text/qtextlayout.cpp 2018-10-25 10:58:19.054347658 +0200
@@ -1006,10 +1006,8 @@ static void addSelectedRegionsToPath(QTe
}
if (lastSelectionWidth > 0) {
- QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight);
- rect.moveLeft(qFloor(rect.left()));
- rect.moveTop(qFloor(rect.top()));
- region->addRect(rect);
+ const QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight);
+ region->addRect(rect.toAlignedRect());
}
lastSelectionX = selectionX;
@@ -1017,10 +1015,8 @@ static void addSelectedRegionsToPath(QTe
}
}
if (lastSelectionWidth > 0) {
- QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight);
- rect.moveLeft(qFloor(rect.left()));
- rect.moveTop(qFloor(rect.top()));
- region->addRect(rect);
+ const QRectF rect = boundingRect & QRectF(lastSelectionX.toReal(), selectionY, lastSelectionWidth.toReal(), lineHeight);
+ region->addRect(rect.toAlignedRect());
}
}
@@ -2135,7 +2131,7 @@ static void setPenAndDrawBackground(QPai
QBrush bg = chf.background();
if (bg.style() != Qt::NoBrush && !chf.property(SuppressBackground).toBool())
- p->fillRect(QRectF(qFloor(r.x()), qFloor(r.y()), r.width(), r.height()), bg);
+ p->fillRect(r.toAlignedRect(), bg);
if (c.style() != Qt::NoBrush) {
p->setPen(QPen(c, 0));
}