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

QPainterPath::simplified() inverts areas in some rare cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.9.1
    • GUI: Painting
    • None

    Description

      Hello,

      We attempted to use QPainterPath::simplified() as a workaround for https://bugreports.qt.io/browse/QTBUG-67058 (drawing paths containing holes which touch or are very close to the outer subpath). Unfortunately, we experienced that for some rare cases filling a simplified path produces very different results than filling a raw path.

      This appears to be some kind of numerical instability in the algorithm, since changing the precision of numbers used to form an area produces drastically different results - filling of an original path seems to be always correct, while filling of a simplified path for some rare complex paths becomes an opposite to what's expected. It's easy to see a practical difference between red and green subpictures in attached screenshots.

      The screenshots can reproduced by compiling an attached test case and running
      ./aexe <number>, where <number> corresponds to a number in the picture file. For example, ./aexe 14 produces the right red subpicture and ./aexe 16 produces the wrong red subpicture. Green subpictures show raw paths and red subpictures show simplified paths.

      Attachments

        Issue Links

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

          Activity

            People

              sletta Gunnar Sletta
              jive Ievgen Liubymkin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes