polygon auto-recenter

The docs say, in regards to polygons:

 vertices (required)

 Array. An array of x,y coordinates. These coordinates will automatically be re-centered about the center   of the polygon.         

 

The code below I would expect to create a grey arrow extending down from the base of a white box, since the 2 vertices for the base of the box match the two at the top of the arrow. 

 

Instead, via this re-centering the arrow has been moved upwards and the shared edges don’t line up.

 

If one wanted to create a network of connected polygons, how would one even find out what this offset was to undo it? Maybe I’m misreading it, but any chance the re-center could be optional?

 

–code:

 

local vertices = { 0, 0, 50, 0, 50, 50, 0, 50  }

local shad = display.newPolygon(100, 100, vertices)

shad:setFillColor  (1, 1, 1)

local vertices2 = {0, 50, 50, 50, 50, 200, 25, 250, 0, 200}

local shad2 = display.newPolygon(100, 100, vertices2)

shad2:setFillColor  (.5, .5, .5)

shad2.alpha = .5

This may be what anchor points are for. If you imagine a bounding box for the polygon, by default the anchor is 0.5,0.5 which means the polygon would be center-aligned, i.e. the center of the bounds coincides with the anchor point.

You can change the alignment anchor of the polygon (to 0,0) so that the top-left edge of the bounds coincides with the anchor point

This may be what anchor points are for. If you imagine a bounding box for the polygon, by default the anchor is 0.5,0.5 which means the polygon would be center-aligned, i.e. the center of the bounds coincides with the anchor point.

You can change the alignment anchor of the polygon (to 0,0) so that the top-left edge of the bounds coincides with the anchor point