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

QPainter::drawPixmapFragments does not take dpi into account.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15
    • GUI: High-DPI
    • None
    • All

    Description

      I'd expect the following implementations to give exactly the same result, assuming:

        QPixmap m_bgCache;
        QPainter* p;
      

      A/

        p->drawPixmap(QPointF{}, m_bgCache);
      

      B/

        QPainter::PixmapFragment fragment{
          0., 0.,
          0., 0.,
          (qreal)m_bgCache.width(), (qreal) m_bgCache.height(),
          1., 1.,
          0., 1.
        };
      
        p->drawPixmapFragments(&fragment, 1, m_bgCache);
      

      Alas, first case gives me good.png and second case gives me bad.png

      Attachments

        1. bad.png
          bad.png
          7 kB
        2. good.png
          good.png
          15 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            jcelerier Jean-Michaël Celerier
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes