KayelGee / token-attacher

MIT License
12 stars 18 forks source link

Token with attachments saved as prototype shifts attachments right when dragged to hex grid #11

Closed Voldemalort closed 3 years ago

Voldemalort commented 3 years ago

I'm not actually sure if this is a hex-grid specific issue, but to replicate try the following:

1) create an actor on a scene with a hex grid and drag the token to the map 2) add a drawing/light source/note that is easy to see if it is centered and center it in the same cell as the token 3) attach the drawing/light source/note to the token 4) assign the token (now with attachment) as the prototype token for the original actor 5) drag the actor back to the map 6) observe the right offset of attached entities (no longer centered)

Love this module and pleasantly surprised that you can even save attachments with a token prototype in the first place. Hoping this is an easy fix. Happy to help debugging further.

Voldemalort commented 3 years ago

offset

The left is a combination of 6 drawings and a light source attached to a token with a transparent image. The right is after saving the left as the prototype token and re-dragging it to the map.

Voldemalort commented 3 years ago

I removed all modules but token attacher and can confirm the bug still exists. I also confirmed that this only appears to happen on a hex-grid map. When in hex-row orientation (even or odd) the original token looks good, but the new token is shifted right (original image). HOWEVER, when I switch to hex-column orientation and re-snap both tokens, the original looks shifted left and the new token is perfectly centered.

This may have something to do with core token alignment in hex grids (center of token is calculated differently depending on row or column arrangement), or it could be based on how this mod calculates linked coordinates (from top left instead of grid center maybe?). I think that's all the info I can give for now.

Voldemalort commented 3 years ago

offset2

In hex columns, original (left) is now uncentered, but the newly dragged-to-map prototype (right) is perfectly centered!

KayelGee commented 3 years ago

Fixed in 4.0