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

QSVGRenderer: multiple transform attribute values are not handled correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9.2
    • 5.5.1, 5.6.1
    • SVG Support
    • None
    • Windows 7 64-Bit, Linux
    • 0fcd0160662941a9ba800b36671e88d82790bd95

    Description

      When rendering SVG Elements with multiple transform values ("transform-list" in W3C terms) containing at least one matrix transformation the resulting image is sometimes not correct. It seems that the combination of a matrix transform and other transformations is not handled properly, e.g.

      transform="translate(...) matrix(...) scale(...)"

      I have attached a small SVG file which shows this behaviour. Also attached is a corresponding PNG image rendered using QSVGRenderer and a PNG image example to show how other programs such as firefox or inkscape render this file.

       

      The origin of the problem seems to be erroneous sequencing of a noncommutative matrix multiplication in parseTransformationMatrix() in qtsvg/qsvghandler.cpp. The attached patch for Qt 5.6.1 fixes this. After applying the patch the provided SVG (as well as other tested SVGs) appear to render fine.

      Attachments

        1. Expected_rendering.png
          Expected_rendering.png
          8 kB
        2. qsvghandler.cpp.patch
          1.0 kB
        3. Qt_rendering.png
          Qt_rendering.png
          8 kB
        4. QtSVG_Bug.svg
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            c.stein Christoph Stein
            c.stein Christoph Stein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes