diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-10-09 16:42:03 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-11-09 08:41:33 +0000 |
commit | 7a4ebf1b714956c7a8b676d83ea8461b2cdc0db3 (patch) | |
tree | 1d420d49aa726a968f6222e1e66aea8bc8a153e2 /src/gui/painting/qstroker.cpp | |
parent | 757d4b85a91643c289d3224082b48b4835868104 (diff) |
Painting: Fix capping of polylines having endpoint == startpoint
A polyline should not be closed like a polygon, even if the start and
end points are identical. But when the primitive was broken down to a
vector path, the stroker no longer had available the information that
it should be open, and so would join the start and end points.
Fixes: QTBUG-65393
Change-Id: I0a566f91cf1a2843fda662b393dbae78c3c38f06
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/painting/qstroker.cpp')
-rw-r--r-- | src/gui/painting/qstroker.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 4776545be6..0a3d802b21 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -369,7 +369,8 @@ void QStrokerOps::strokeEllipse(const QRectF &rect, void *data, const QTransform QStroker::QStroker() : m_capStyle(SquareJoin), m_joinStyle(FlatJoin), m_back1X(0), m_back1Y(0), - m_back2X(0), m_back2Y(0) + m_back2X(0), m_back2Y(0), + m_forceOpen(false) { m_strokeWidth = qt_real_to_fixed(1); m_miterLimit = qt_real_to_fixed(2); @@ -748,7 +749,7 @@ template <class Iterator> bool qt_stroke_side(Iterator *it, } } - if (start == prev) { + if (start == prev && !stroker->forceOpen()) { // closed subpath, join first and last point #ifdef QPP_STROKE_DEBUG qDebug("\n ---> (side) closed subpath"); |