bevy/crates/bevy_text/src
Michel van der Hulst 6ce7ce208e Change UI coordinate system to have origin at top left corner (#6000)
# Objective
Fixes #5572

## Solution

Approach is to invert the Y-axis of the UI Camera by changing the UI projection matrix to render the UI upside down.

After that I'm trying to fix all issues, that pop up:
- interaction expected the "old" position
- images and text were displayed upside-down
- baseline of text was based on the top of the glyph instead of bottom

... probably a lot more.

---

Result when running examples:
<details>
    <summary>Button example</summary>

main branch:
![button main](https://user-images.githubusercontent.com/4232644/190856087-61dd1d98-42b5-4238-bd97-149744ddfeba.png)
this pr:
![button pr](https://user-images.githubusercontent.com/4232644/190856097-3f4bc97a-ed15-4e97-b7f1-2b2dd6bb8b14.png)

</details>

<details>
    <summary>Text example</summary>

m
![text main](https://user-images.githubusercontent.com/4232644/192142831-4cf19aa1-f49a-485e-af7b-374d6f5c396c.png)
ain branch: 


this pr:
![text pr fixed](https://user-images.githubusercontent.com/4232644/192142829-c433db3b-32e1-4ee8-b493-0b4a4d9c8e70.png)


</details>

<details>
    <summary>Text debug example</summary>

main branch:
![text_debug main](https://user-images.githubusercontent.com/4232644/192142822-940aefa6-e502-410b-8da4-5570f77b5df2.png)

this pr:
![text_debug pr fixed](https://user-images.githubusercontent.com/4232644/194547010-8c968f5c-5a71-4ffc-871d-790c06d48016.png)

</details>

<details>
    <summary>Transparency UI example</summary>

main branch:
![transparency_ui main](https://user-images.githubusercontent.com/4232644/190856172-328c60fe-3622-4598-97d5-2f1595db13b3.png)


this pr:
![transperency_ui pr](https://user-images.githubusercontent.com/4232644/190856179-a2dafb99-41ea-45a9-9dd6-400fa3ef24b9.png)

</details>

<details>
    <summary>UI example</summary>

**ui example**
main branch:
![ui main](https://user-images.githubusercontent.com/4232644/192142812-e20ba31a-6841-46d9-a785-4198cf22dc99.png)

this pr:
![ui pr fixed](https://user-images.githubusercontent.com/4232644/192142788-cc0b74e0-7710-4faa-b5a2-60270a5da77c.png)

</details>

## Changelog
UI coordinate system and cursor position was changed from bottom left origin, y+ up to top left origin, y+ down.

## Migration Guide
All flex layout should be inverted (ColumnReverse => Column, FlexStart => FlexEnd, WrapReverse => Wrap)
System where dealing with cursor position should be changed to account for cursor position being based on the top left instead of bottom left
2022-10-11 12:51:44 +00:00
..
error.rs Limit FontAtlasSets (#5708) 2022-09-19 16:12:12 +00:00
font.rs small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
font_atlas.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
font_atlas_set.rs Limit FontAtlasSets (#5708) 2022-09-19 16:12:12 +00:00
font_loader.rs Add support for OTF fonts (#1200) 2021-01-03 12:10:23 -08:00
glyph_brush.rs Change UI coordinate system to have origin at top left corner (#6000) 2022-10-11 12:51:44 +00:00
lib.rs Exclusive Systems Now Implement System. Flexible Exclusive System Params (#6083) 2022-09-26 23:57:07 +00:00
pipeline.rs make Handle::<T> field id private, and replace with a getter (#6176) 2022-10-06 13:33:30 +00:00
text.rs bevy_reflect: Update enum derives (#5473) 2022-08-02 22:40:29 +00:00
text2d.rs make Handle::<T> field id private, and replace with a getter (#6176) 2022-10-06 13:33:30 +00:00