ymobe/rapanui

Creating Shapes offset by center leads to odd code

Opened this issue · 1 comments

I spent a hour trying to figure out why this:
nextLink = RNFactory.createRect(link.x, link.y, width, height, { rgb = { 255, 0, 0 } })

Is not the same as:
nextLink = RNFactory.createRect(0, 0, width, height, { rgb = { 255, 0, 0 } })
nextLink.x = link.x
nextLink.y = link.y

It would be better to either override the equals to do the same (not the best way to do it) or have objects created with the correct x, y and have the user fix the difference. otherwise you get code that simply does not make sense.

This is also causing huge issues with joints being offset.