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
eca8220761
commit
55ee49b7ad
@ -87,10 +87,16 @@ impl TextPipeline {
|
|||||||
|
|
||||||
let size = compute_text_bounds(§ion_glyphs, |index| scaled_fonts[index]).size();
|
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 {
|
let h_anchor = match text_alignment {
|
||||||
JustifyText::Left => 0.0,
|
JustifyText::Left => 0.0,
|
||||||
JustifyText::Center => bounds.x * 0.5,
|
JustifyText::Center => h_limit * 0.5,
|
||||||
JustifyText::Right => bounds.x * 1.0,
|
JustifyText::Right => h_limit * 1.0,
|
||||||
}
|
}
|
||||||
.floor();
|
.floor();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user