Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274066

Polygon filled outside its area when very large coordinates are used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: openjfx11, openjfx17
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
      None

      Description

      Rendering a filled polygon that includes vertices with very large coordinates results in drawing glitches as the viewed area approaches those high coordinates: the fill is sometimes drawn outside the polygon, or partly outside and partly inside.

      The attached test case can be used to reproduce the issue on any platform (Linux, Mac and Windows), with any output scale (DPI 1.0, 1.5 or 2.0), and with any JavaFX version from 11, 17 or head.

      There is a maximum value for the X coordinate that works as expected (see PolygonGood.png):

      DPI 1.0 -> 4194304.250 + scene width
      DPI 2.0 -> 4194304.250/2.0 + scene width

      However, by simply adding 0.001 to it (or any other greater value):

      DPI 1.0 -> 4194304.250 + scene width + 0.001
      DPI 2.0 -> 4194304.250/2.0 + scene width + 0.001

      then it fails (see PolygonBad.png): the polygon fill is shown outside the polygon itself.

      It doesn't depend on the Y coordinate (which can be as big as the X one), so it is not related to the bad form factor of the shape.

      It does depend on the screen output scale, the scene width or the translate coordinates that are used to see the end of the polygon, though.

        Attachments

        1. PolygonBad.png
          PolygonBad.png
          253 kB
        2. PolygonGood.png
          PolygonGood.png
          252 kB
        3. PolygonTest-1.java
          1 kB

          Activity

            People

            Assignee:
            lbourges Laurent Bourg├Ęs
            Reporter:
            jpereda Jose Pereda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: