Follow-up Comment #1, bug #20935 (project wesnoth):
Sprites can't be counted on to be 72x72 anymore; for any image widgets where
they need to fit in a fixed size (such as the sidebar in-game), they need to
be scaled down to fit.
This scaling needs to be the same proportion on both axes.
Our sprites also are not guaranteed to be "balanced" for visual weight - some
sprites jut off in odd-angles in a way that would confuse a simple/naive
centering algorithm. The horsemen are probably a good example of this,
because the all carry a lance that juts out to the upper-left, leaving a great
deal of empty pixels above them which are nevertheless within the "minimum
bounding box containing all opaque pixels".
To counteract this, it may be advisable to ensure that as a sprite is cropped
to remove fully transparent margins, that margins in the same dimension are
both as small as the smallest one. i.e.
vertical_margin = std::min(top_margin, bottom_margin)
Same for horizontal. This will keep a sprite centered even if it juts off
unevenly to just one side.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?20935>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs