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

QPainter::drawLine draws lines with incorrect width / Raster paint engine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.0.2
    • GUI: Painting
    • None
    • Qt 5.1.0
      GCC 4.8.0
      Windows 8 64bits

    Description

      This seems to appear only when the width is an odd integer, and in release mode. This issue does not appear when compiled in debug mode.

      The raster paint engine is used.

      QImage img(200, 200, QImage::Format_ARGB32_Premultiplied);
      img.fill(Qt::transparent);
      QPainter p(&img);
      p.setPen(QPen(QColor(255, 255, 0), 3, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
      p.drawLine(50, 50, 100, 50);
      img.save("foo.png"); // The line has a width of 2 pixels.
      // If the pen had a width of 5 pixels, the line would have had a width of 6 pixels...

      Attachments

        Issue Links

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

          Activity

            People

              sletta Gunnar Sletta
              laugilus Sébastien Bini
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes