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

Image sourceSize binding causes the size to become smaller unexpectedly

    XMLWordPrintable

Details

    Description

      Following will make rendered svg smaller by device pixel ratio (ie. at 2x will become half size):

      Image {
        source: "file.svg"
        sourceSize: Qt.size(width,height)
      }
      

      Looks like it is evaluated before the final size is known, which is expected, so it sets it 0x0 initially. But after the image is loaded, the size reported by width and height properties seems to be half the expected size at 2x scale ratio.

      Attachments

        1. comparison.qml
          2 kB
        2. dprtest.qml
          0.4 kB
        3. qtbug81018.tar.gz
          4 kB
        4. qtbug94901-ubuntu-DPR-2-before-and-after.png
          qtbug94901-ubuntu-DPR-2-before-and-after.png
          119 kB
        5. rect.svg
          18 kB
        6. Screenshot from 2021-10-14 11-06-35.png
          Screenshot from 2021-10-14 11-06-35.png
          54 kB
        7. zero.png
          zero.png
          2 kB

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              poikelin Joni Poikelin
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes