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

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

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes