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
          Eirik Aavitsland
        2. dprtest.qml
          0.4 kB
          Eirik Aavitsland
        3. qtbug81018.tar.gz
          4 kB
          Joni Poikelin
        4. qtbug94901-ubuntu-DPR-2-before-and-after.png
          119 kB
          Mitch Curtis
        5. rect.svg
          18 kB
          Eirik Aavitsland
        6. Screenshot from 2021-10-14 11-06-35.png
          54 kB
          Mitch Curtis
        7. zero.png
          2 kB
          Eirik Aavitsland

        Issue Links

          For Gerrit Dashboard: QTBUG-81018
          # Subject Branch Project Status CR V

          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