Chlumsky / msdfgen

Multi-channel signed distance field generator
MIT License
3.91k stars 404 forks source link

Unclear usage of Shape's bounds function #91

Closed serhii-rieznik closed 4 years ago

serhii-rieznik commented 4 years ago

Calling Shape's bounds function implicitly assumes that l, b, t and r values should be properly initialized. This is not obvious, and could lead to the incorrect bounding boxes.

For example, I was default initializing this values with zero, while actual frame was above zero, and this resulted with bbox like {0, 0, r, t} rather than {l, b, r, t} (where l, t, r, b are some concrete values).

I've created PR to fix this: https://github.com/Chlumsky/msdfgen/pull/90

Chlumsky commented 4 years ago

The Shape class bounds API has been revised to improve clarity.