I noticed a strange behavior with the polygon drawing with an offset.
I have a sky made out of polygons filled with a pattern. I use the setDrawOffset to move the camera, and change at once all the positions where the polygons (clouds) are displayed.
If I draw this polygon, it's fine, until the horizontal offset goes under -70
So
gfx.setDrawOffset(-30, 0)
gfx.fillPolygon(0, 0, 9, -3, 16, -3, 20, -5, 26, -2, 38, -5, 43, -5, 46, -3, 49, -5, 51, -11, 63, -11, 69, -5, 99, 0)
The polygon is correctly drawn, partially clipped by the left side of the screen
But with this offset:
gfx.setDrawOffset(-70, 0)
None of the polygon is drawn, even though about 30 pixels should still be on screen
I think it's due to a problem with two much distance between 2 vertices.
If I add one vertice between the 2 extreme vertices in the horizontal axis:
Like this:
gfx.fillPolygon(0, 0, 9, -3, 16, -3, 20, -5, 26, -2, 38, -5, 43, -5, 46, -3, 49, -5, 51, -11, 63, -11, 69, -5, 99, 0, 50, 0)
then the polygon is drawn correctly even with an offset inferior to -70 pixels.
So it looks like if a polygon has a side that is too long, then if it's clipped above a certain value by the offset, the whole polygon is skipped, instead of being properly clipped.