diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-10-10 12:38:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-19 02:43:05 +0200 |
commit | 7b8e10ddd02693b3d6b7a7e74d2103787f6e76ac (patch) | |
tree | 4147954620057575e543eb0b6f09385b265cefb3 /src/gui/painting/qcosmeticstroker.cpp | |
parent | ae3ad0ad211e6b9d745193fc049ad6ee07d731f0 (diff) |
Fixed inconsistent QPainter fill rules for aliased painting.
Qt 5 is the time to get rid of all the old inconsistencies in the raster
paint engine caused by trying to preserve the old X11 based
coordinate system where (0, 0) is in the center of the top-left pixel
instead of the upper left corner of said pixel. However, this was only
adhered for line drawing and path / rect filling, and not for image or
pixmap drawing and not at all when doing antialiased painting. By
defining the antialiased coordinate system as being the right one and
letting the aliased fill rules follow from that we finally end up with
some consistent behavior that doesn't lead to surprises and workarounds
in application code.
It is still possible for applications to get the old behavior by
setting the QPainter::Qt4CompatiblePainting render hint. This should
make porting easier for the few cases where an application relies on the
aliased fill rules we used to have in Qt 4.
Task-number: QTBUG-27500
Change-Id: If86b95e77d838ec83033d64af86632b9a73c74a9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui/painting/qcosmeticstroker.cpp')
-rw-r--r-- | src/gui/painting/qcosmeticstroker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index f99edc6194..2eab7b25c5 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -414,7 +414,7 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal if (clipLine(rx1, ry1, rx2, ry2)) return; - const int half = 31; + const int half = legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; int y1 = toF26Dot6(ry1) + half; int x2 = toF26Dot6(rx2) + half; @@ -707,7 +707,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, if (stroker->clipLine(rx1, ry1, rx2, ry2)) return; - static const int half = 31; + const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; int y1 = toF26Dot6(ry1) + half; int x2 = toF26Dot6(rx2) + half; |