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

Incorrect drawing QPainter::drawPolygon (drawPolyline) if drawing primitive that exceeds drawing area.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 4.8.7
    • GUI: Painting
    • None
    • Linux/Other display system, Windows

    Description

      Example.

      { QPixmap Buffer(100, 100); QPainter painter; painter.begin(&Buffer); painter.setPen(QPen(Qt::red)); painter.setBrush(QBrush(Qt::yellow)); QPolygon poly; poly << QPoint(200,-100) << QPoint(200,200) << QPoint(-1,200) << QPoint(-1,-100) << QPoint(200,-100); painter.drawPolygon(poly); // or drawPolyline(poly) Buffer.save("c:/1.png", "PNG"); }

      The result pixmap must contain yellow rectangle without any outline.
      But there is a DIAGONAL red line.

      Note 1.
        Using QPainterPath with the same data makes correct drawing.
        QPainterPath path;
        path.addPolygon(poly);
        painter.drawPath(path);

      Note 2.
        Changing X coordinate -1 to any other number (-2, -1000, etc) makes correct drawing.

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            yuris Yuri S
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes