bevy/crates/bevy_ui/src
ickshonpe 03404c48ca
UI text rotation and scaling fix (#11326)
# Objective

UI node text is drawn in the wrong position after rotation or scaling.


![294723406-d031a3e6-a4f9-48b4-a66a-ee963100a8b9](https://github.com/bevyengine/bevy/assets/27962798/2755e2e3-6a03-4ee8-8676-bdcaa72ec678)

## Solution
In `extract_text_uinodes` to set the text's offset create a translation
matrix and multiply it by the UI node's transform.

Previously the offset was just added directly to the translation of the
Node's `GlobalTransform`, which meant no scaling or rotation would be
applied to the offset.

<img width="961" alt="296440025-537ec11c-1ea1-469c-8eec-2ad4ae012095"
src="https://github.com/bevyengine/bevy/assets/27962798/eae1a1d2-1369-47ad-8963-3862d03ec0bf">

<img width="961" alt="296440156-dd04029d-8112-4fa5-89a2-56d7acab66df"
src="https://github.com/bevyengine/bevy/assets/27962798/90b1b6db-13f4-4745-9f14-7c1661baad50">

Fixes #11241
2024-01-13 22:21:40 +00:00
..
layout Change Window scale factor to f32 (adopted) (#10897) 2023-12-14 14:56:40 +00:00
render UI text rotation and scaling fix (#11326) 2024-01-13 22:21:40 +00:00
widget Unload render assets from RAM (#10520) 2024-01-03 03:31:04 +00:00
accessibility.rs resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
camera_config.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
focus.rs Made the remaining types from bevy_ui to reflect the Default trait if… (#11199) 2024-01-03 18:57:05 +00:00
geometry.rs Made the remaining types from bevy_ui to reflect the Default trait if… (#11199) 2024-01-03 18:57:05 +00:00
lib.rs resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
measurement.rs Change the default for the measure_func field of ContentSize to None. (#9346) 2023-08-07 23:06:40 +00:00
node_bundles.rs Rename TextAlignment to JustifyText. (#10854) 2023-12-05 03:00:41 +00:00
stack.rs Remove unnecessary parentheses (#10990) 2023-12-16 02:26:18 +00:00
ui_material.rs Provide GlobalsUniform in UiMaterial shaders (#10739) 2023-11-28 12:08:28 +00:00
ui_node.rs Made the remaining types from bevy_ui to reflect the Default trait if… (#11199) 2024-01-03 18:57:05 +00:00
update.rs Give UI nodes with Display::None an empty clipping rect (#10942) 2023-12-23 05:07:30 +00:00