zyxw59 / formationbot-rs

FormationBot renders square dance formations as pictures, to aid discussions of calling
MIT License
0 stars 1 forks source link

Initial blank rows aren't cropped #3

Closed zyxw59 closed 3 years ago

zyxw59 commented 3 years ago

If a formation begins with a blank row, e.g. / < > / < >, that row won't be cropped. This is because min_y is initialialzed to 0.0, so even if the first dancer is lower in the image, 0.0 will always be included in the bounds.

This also happens if e.g. all the dancers are on one side (left or right) of the formation: > > . . . will be 1½ dancers wider than > >.

Maybe empty spaces (.) should be counted as dancers for the purpose of calculating bounds?

zyxw59 commented 3 years ago

This can be resolved by initializing the bounds to f64::NAN instead of 0.0