Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12172

Bug when uniting polygon with a QRectF of size 0,0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.7.0
    • GUI: Painting
    • 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);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            holmsted Lasse Holmstedt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes