[TextServer] Add support for trimming edge spaces on line break.
This commit is contained in:
parent
1c037c89d4
commit
7aad14a4b6
9 changed files with 124 additions and 21 deletions
|
|
@ -486,8 +486,9 @@ void Label3D::_shape() {
|
|||
case TextServer::AUTOWRAP_OFF:
|
||||
break;
|
||||
}
|
||||
PackedInt32Array line_breaks = TS->shaped_text_get_line_breaks(text_rid, width, 0, autowrap_flags);
|
||||
autowrap_flags = autowrap_flags | TextServer::BREAK_TRIM_EDGE_SPACES;
|
||||
|
||||
PackedInt32Array line_breaks = TS->shaped_text_get_line_breaks(text_rid, width, 0, autowrap_flags);
|
||||
float max_line_w = 0.0;
|
||||
for (int i = 0; i < line_breaks.size(); i = i + 2) {
|
||||
RID line = TS->shaped_text_substr(text_rid, line_breaks[i], line_breaks[i + 1] - line_breaks[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue