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

Add support for TransformRef attribute in SVG module

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P3: Somewhat important
    • Some future release
    • 4.2.1
    • SVG Support
    • None

    Description

      SVG 1.2 introduced the TransformRef attribute and it would be nice if it was supported in Qt.

      "provide a method by which graphical objects can remain fixed in the
      viewport without being scaled or rotated. Use cases include thin lines
      that do not become fatter on zooming in..."

      This section is listed under 7.7 Constrained Transformations,
      http://www.w3.org/TR/SVGMobile12/coords.html, and under 7.7.5 The
      TransformRef value: "By using the ref() attribute on the transform
      attribute it is possible to provide constrained transformations."

      Thus, the following svg file syntax should fix the rectangle in the face
      of scaling. Please see the Example: ref() transform at the following
      w3.org link above.

      <svg xml:id="root" viewBox="0 0 100 100" version="1.2"
      baseProfile="tiny">
      <line x1="0" x2="100" y1="0" y2="100"/>
      <rect xml:id="r" transform="ref(svg)"
      x="45" y="45" width="10" height="10"/>
      </svg>

      According to the example, the viewport is (200,200). So the line will
      be drawn from (0,0) to (200,200) and the rectangle will be drawn in the
      middle at (90,90,20,20). But if you zoom any bigger, keeping the
      viewport dimensions at (200,200), the line will grow but the rectangle
      should stay at (90,90,20,20).

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes