Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
4.7.0
-
None
Description
When uniting a polygon with a rectangle that has (0,0) size, the uniting results in a strange drawing behavior. See code below and attached screenshot for the result. The case when object being united is zero-size could be taken into account as an early reject.
QGraphicsScene *scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); QRectF r(85, 285, 125-85, 325-285); QPolygonF polyRect(r); QRectF zero(104, 304, 0,0); QPolygonF zeroPoly(zero); QGraphicsPolygonItem *poly = new QGraphicsPolygonItem; zeroPoly = poly->mapToScene(zeroPoly); polyRect = polyRect.united(zeroPoly); poly->setPolygon(polyRect); poly->setPen(QPen(QColor(Qt::red))); scene->addItem(poly);