mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
text position: use size instead of bounds (#13858)
# Objective - #13846 introduced a bug where text not bound was not displayed ## Solution - bounds are infinite - use computed size instead, that already should be using the available bounds
This commit is contained in:
parent
aaccbe88aa
commit
d8f42608f9
1 changed files with 8 additions and 2 deletions
|
@ -87,10 +87,16 @@ impl TextPipeline {
|
|||
|
||||
let size = compute_text_bounds(§ion_glyphs, |index| scaled_fonts[index]).size();
|
||||
|
||||
let h_limit = if bounds.x.is_finite() {
|
||||
bounds.x
|
||||
} else {
|
||||
size.x
|
||||
};
|
||||
|
||||
let h_anchor = match text_alignment {
|
||||
JustifyText::Left => 0.0,
|
||||
JustifyText::Center => bounds.x * 0.5,
|
||||
JustifyText::Right => bounds.x * 1.0,
|
||||
JustifyText::Center => h_limit * 0.5,
|
||||
JustifyText::Right => h_limit * 1.0,
|
||||
}
|
||||
.floor();
|
||||
|
||||
|
|
Loading…
Reference in a new issue