bevy/crates/bevy_ui
ickshonpe 9d9750b928
TextLayoutInfo::size should hold the drawn size of the text, and not a scaled value. (#7794)
# Objective

`TextLayoutInfo::size` isn't the drawn size of the text, but a scaled
value. This is fragile, counter-intuitive and makes it awkward to
retrieve the correct value.

## Solution

Multiply `TextLayoutInfo::size` by the reciprocal of the window's scale
factor after generating the text layout in `update_text2d_layout` and
`bevy_ui::widget::text_system`.

---

fixes: #7787

## Changelog

* Multiply `TextLayoutInfo::size` by the reciprocal of the scale factor
after text computation to reflect the actual size of the text as drawn.
* Reorder the operations in `extract_text2d_sprite` to apply the
alignment offset before the scale factor scaling.

## Migration Guide

The `size` value of `TextLayoutInfo` is stored in logical pixels and has
been renamed to `logical_size`. There is no longer any need to divide by
the window's scale factor to get the logical size.
2023-09-11 18:56:16 +00:00
..
src TextLayoutInfo::size should hold the drawn size of the text, and not a scaled value. (#7794) 2023-09-11 18:56:16 +00:00
Cargo.toml Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00