From edc9acd6a0c082b7d6c7810700e77a9d990014c6 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 3 Nov 2009 17:41:52 +0100 Subject: Fixed QPainterPath::addRoundedRect() for paths with Qt::WindingFill. QPainterPath::addRoundRect()/addRoundedRect() added the path in counter-clockwise order, while other methods added paths in clockwise order. For Qt::OddEvenFill, the order doesn't matter, but it matters for Qt::WindingFill. Fixed by adding rounded rects in clockwise order like the other shapes. Task-number: QTBUG-1537 Reviewed-by: Trond --- src/gui/painting/qpainterpath.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index c40bcee..8133793 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -3037,11 +3037,11 @@ void QPainterPath::addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadi bool first = d_func()->elements.size() < 2; - arcMoveTo(x, y, rxx2, ryy2, 90); - arcTo(x, y, rxx2, ryy2, 90, 90); - arcTo(x, y+h-ryy2, rxx2, ryy2, 2*90, 90); - arcTo(x+w-rxx2, y+h-ryy2, rxx2, ryy2, 3*90, 90); - arcTo(x+w-rxx2, y, rxx2, ryy2, 0, 90); + arcMoveTo(x, y, rxx2, ryy2, 180); + arcTo(x, y, rxx2, ryy2, 180, -90); + arcTo(x+w-rxx2, y, rxx2, ryy2, 90, -90); + arcTo(x+w-rxx2, y+h-ryy2, rxx2, ryy2, 0, -90); + arcTo(x, y+h-ryy2, rxx2, ryy2, 270, -90); closeSubpath(); d_func()->require_moveTo = true; @@ -3094,11 +3094,11 @@ void QPainterPath::addRoundRect(const QRectF &r, int xRnd, int yRnd) bool first = d_func()->elements.size() < 2; - arcMoveTo(x, y, rxx2, ryy2, 90); - arcTo(x, y, rxx2, ryy2, 90, 90); - arcTo(x, y+h-ryy2, rxx2, ryy2, 2*90, 90); - arcTo(x+w-rxx2, y+h-ryy2, rxx2, ryy2, 3*90, 90); - arcTo(x+w-rxx2, y, rxx2, ryy2, 0, 90); + arcMoveTo(x, y, rxx2, ryy2, 180); + arcTo(x, y, rxx2, ryy2, 180, -90); + arcTo(x+w-rxx2, y, rxx2, ryy2, 90, -90); + arcTo(x+w-rxx2, y+h-ryy2, rxx2, ryy2, 0, -90); + arcTo(x, y+h-ryy2, rxx2, ryy2, 270, -90); closeSubpath(); d_func()->require_moveTo = true; -- cgit v0.12