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.
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
Issue Links
- duplicates
-
JDK-8287604 Update MarlinFX to 0.9.4.6
- Resolved
- relates to
-
JDK-8287604 Update MarlinFX to 0.9.4.6
- Resolved
-
JDK-8297230 Update Marlin2D to 0.9.4.6
- Resolved