Closed karlwilcox closed 1 year ago
..or is the problem the charge placement itself isn't exactly centered?
Nope — the charge top edge is 40px from the square top, as is the bottom edge.
Good point - there may well be other charges with this characteristic. The issue arises because the charge is centered on its "bounding box" (i.e. its maximum extents) rather than its "natural" centre (which of course may be different for each charge).
Proper fix: add some charge metadata to apply an appropriate adjustment
Quick fix: adjust the bounding box so it's centre is in the right place (so the pointy bit at the top is outside the box but still visible.
I'll do the quick fix for now but think about the proper one!
Apart from obvious geometric shapes with bits sticking out to unbalance the bounding box, there are likely also a few animal charges that don't have the best match with visual centres (particularly regarding to dexter/sinister).
The quick fix works well, so we should go with that for now. It might break "conjoined" charges but that is less of a problem than incorrect placement. If any other charges are like this just raise an issue for it.
There's still a slight offset if you look closely. My suggestion of "40px" might not have been precise.
Yes, it is quite hard to get the centre point right by adjusting the boundary - I'm going to look at a different technique and have a bit of metadata that specifies the exact centre by coordinates.
!todo
compass rose
centering The visual centre of the compass rose charge should not be the geometric centre of the charge bounding box.