alexheretic / glyph-brush

Fast GPU cached text rendering
Apache License 2.0
688 stars 52 forks source link

Improve api document of Section's screen_position #142

Open mikialex opened 3 years ago

mikialex commented 3 years ago

Accroding to doc: https://docs.rs/glyph_brush/0.7.2/glyph_brush/struct.Section.html#structfield.screen_position, screen position is in pixels from top-left. Defaults to (0, 0). But in fact it's only true when the layout config in section is horizon: left, vertical: top. This position is actually anchor the alignment center, not the "top-left" position.

alexheretic commented 3 years ago

Yep good spot. It is explained a bit buried at https://docs.rs/glyph_brush/0.7.2/glyph_brush/enum.HorizontalAlign.html

This could definitely be clearer, we could say it's top-left for the default layout, see horizontal & vertical align docs. It could also be different for custom layouts.