drawPolygon() bug

Hi folks,

I've discovered an issue with drawPolygon().

When the array of points contains all positive x co-ordinates, everything renders as expected.
However, if any of the points contains a negative x co-ord value (off the left part of the screen), a rendering artifact is generated.

I suspect this has to do with the native drawPolygon routine. It must be always returning "0" for any negative value of the x co-ord.
This does not affect the y co-ord.

Also occurs on physical devices.

Here's a video of the problem;
https://gfycat.com/FineQueasyFishingcat

Here's the source;
https://github.com/sunpazed/garmin-polybug





Cheers.