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

Numerical instability with QLineF::intersect and QLineF::BoundedIntersection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.6.3, 5.12.0
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None
    • Platform/s:
      macOS, Windows

      Description

      When trying to intersect (almost) parallel lines, QLineF::intersect may return the intersection type incorrectly as QLineF::BoundedIntersection when it is actually QLineF::UnboundedIntersection (or QLineF::NoIntersection)

      Since the values in the debugger are converted from double and are not the same as in memory, I dumped the memory values and attached the images. I also created a test code that demonstrates the issue.

        Attachments

        1. l.png
          l.png
          23 kB
        2. l1.png
          l1.png
          31 kB
        3. debugInfo.png
          debugInfo.png
          447 kB
        4. lines.png
          lines.png
          348 kB
        5. testIntersect.cpp
          1 kB
        6. main.cpp
          0.5 kB
        For Gerrit Dashboard: QTBUG-75146
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              ahi Adriel Jr.
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes