mirror of
https://github.com/godotengine/godot
synced 2024-09-05 13:38:29 +00:00
Fix freezes when tab is zero or negative width.
This commit is contained in:
parent
d746475708
commit
af6758e008
|
@ -3668,6 +3668,12 @@ float TextServerAdvanced::shaped_text_tab_align(RID p_shaped, const PackedFloat3
|
|||
const_cast<TextServerAdvanced *>(this)->shaped_text_update_breaks(p_shaped);
|
||||
}
|
||||
|
||||
for (int i = 0; i < p_tab_stops.size(); i++) {
|
||||
if (p_tab_stops[i] <= 0) {
|
||||
return 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
int tab_index = 0;
|
||||
float off = 0.f;
|
||||
|
||||
|
|
|
@ -2665,6 +2665,12 @@ float TextServerFallback::shaped_text_tab_align(RID p_shaped, const PackedFloat3
|
|||
const_cast<TextServerFallback *>(this)->shaped_text_update_breaks(p_shaped);
|
||||
}
|
||||
|
||||
for (int i = 0; i < p_tab_stops.size(); i++) {
|
||||
if (p_tab_stops[i] <= 0) {
|
||||
return 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
int tab_index = 0;
|
||||
float off = 0.f;
|
||||
|
||||
|
|
Loading…
Reference in a new issue