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

[REG 5.14.0] SVG rendering no longer fills the available painting area

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.14.1
    • 5.14.0
    • SVG Support
    • None
    • All

    Description

      For 5.14.0, a long missing feature was implemented in QtSVG, namely rendering according to the aspect ratio defined in the SVG itself: https://codereview.qt-project.org/c/qt/qtsvg/+/262813 Earlier, SVG renderihng would always ignore this, and just use the whole available painting area as target.

      However, the fature was introduced as non-optional, and with no way to opt out. In hindsight, that was an error, since it caused a lot of regressions in existing code that depends on the previous behaviour. There have been a high number of bug reports.

      I (aavit) have since tried to work around this by changing those render() methods that take an explicit target rect use the old behaviour, while the default render() method use the new behaviour: https://codereview.qt-project.org/c/qt/qtsvg/+/285186

      But I think that this is not a satisfactory solution, since

      1. It still causes regressions for all users of the default render() method, i.e. most
      2. It makes for bad API, with a surprising difference in behavior between similar functions
      3. In particular, it causes surprising difference in the result if SVG image file reading whenever scaling is specified, compared to when it is not, since the SVG image IO handler uses the render-to-target-rect method in the former case but not the latter.

      I see no way out of all these issues within the limits of a patch release. Hence, I suggest that we

      1. Remove the whole aspect-ratio feature again for 5.14.1; i.e. reverting to the pre-5.14 behavior in all cases.
      2. Introduce it again as an opt-in feature for 5.15. For example, by adding an optional parameter of type Qt::AspectRatioMode to all the render(...) methods.

       

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            vgt Eirik Aavitsland
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes