Produce more correct clip path for QGraphicsShapeItem

If no pen is set on the item, we can completely ignore the
pen for the creation of the items shape. This both speeds
up the creation of the shape and applying it as a clip mask
as well as creating more correct results.

Task-number: QTBUG-32846
Change-Id: I5f6f690256c71309713d8f746e67599af3088dd7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Lars Knoll 2014-10-20 13:35:16 +02:00
parent dc267036e3
commit 90a4c69b25

View File

@ -797,7 +797,7 @@ static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, cons
// if we pass a value of 0.0 to QPainterPathStroker::setWidth()
const qreal penWidthZero = qreal(0.00000001);
if (path == QPainterPath())
if (path == QPainterPath() || pen == Qt::NoPen)
return path;
QPainterPathStroker ps;
ps.setCapStyle(pen.capStyle());