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

Unnecessary rounding of QRectF in QCoreGraphicsPaintEngine::drawPixmap

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.4
    • 4.7.2
    • GUI: Painting
    • None
    • Qt 4.7.2, OS X 10.6.6
    • 004989ce2e6a014df39ebbb30dccda88705ded8f

    Description

      At line #972 in qpaintengine_mac.cpp, the input QRectF is rounded into integer values before converting into a CGRect:

      qpaintengine_mac
      CGRect rect = CGRectMake(qRound(r.x()), qRound(r.y()), qRound(r.width()), qRound(r.height()));
      

      This is causing some positioning error due to the rounding when the transformation calls for scaling like 0.07. The same conversion in QCoreGraphicsPaintEngine::drawImage() does not do the rounding.

      The issue causes tiles of images to either overlap or leave space (typically 1 pixel) between them. Using QPainter::drawImage() does not have the same problem. Removing qRound calls in that line fixes the issue.

      Attachments

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

        Activity

          People

            rodal Samuel Rødal
            stephenju Stephen Chu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes