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

QML Canvas arcTo function doesn't work the same as the HTML5 equivalent

    XMLWordPrintable

Details

    • 82b21536e72a640699594b3e82a5a6182a95521c

    Description

      I was trying to implement a half-rounded rectangle (rounded on the top two corners, flat on the bottom). After some frustration trying to guess how arcTo would work, I went looking for a rounded rectangle Canvas tutorial and found this:

      http://www.dbp-consulting.com/tutorials/canvas/CanvasArcTo.html

      So I will attach a simplified HTML example and a QML example, which both use the exact same code to try to render a fully-rounded rectangle. If you run the QML example with the master branch Qt5 it doesn't render correctly (I will attach screenshots too).

      The trouble with using arc() rather than arcTo() is when trying to create a closed shape, so that both filling and stroking will work, arc() does not move the "current point" in the context; the next line segment will continue from where the arc started rather than where it ended. That may or may not be a bug, but then we really need arcTo() to be functional to be able to create closed paths with rounded segments.

      Attachments

        1. CanvasArcTo.html
          1 kB
        2. CanvasArcTo.png
          CanvasArcTo.png
          6 kB
        3. rounded-rect.png
          rounded-rect.png
          3 kB
        4. rounded-rect.qml
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            charles Charles Yin (closed Nokia identity) (Inactive)
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes