The below image shows a blue polygon with in red what the contains check was actually going through.
The contains code was wrongly using code that filters out duplicate points, causing 2 edges to be completely skipped and a direct line being drawn between two vertices that are not connected.
Additionally the first and last points were also being connected even though the polygon is not closed.
Two bugs were fixed in this code.
The below image shows a blue polygon with in red what the contains check was actually going through.
The contains code was wrongly using code that filters out duplicate points, causing 2 edges to be completely skipped and a direct line being drawn between two vertices that are not connected.
Additionally the first and last points were also being connected even though the polygon is not closed.