summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorHendrik Brucker <hendrik.brucker@mail.de>2021-08-21 00:22:09 +0200
committerHendrik Brucker <hendrik.brucker@mail.de>2021-08-21 00:22:09 +0200
commit72e49eadecf1d4420e50d864bde449d14ccefd01 (patch)
tree47751f722cbde33d76f758ae865c1622636f0f79 /servers
parenta03157928622b8c4048ede29cd6f1a40df893d1b (diff)
Fix ItemList layout (+EditorFileDialog)
Diffstat (limited to 'servers')
-rw-r--r--servers/text_server.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/servers/text_server.cpp b/servers/text_server.cpp
index 6bace8cf9e..e51e229418 100644
--- a/servers/text_server.cpp
+++ b/servers/text_server.cpp
@@ -665,9 +665,7 @@ Vector<Vector2i> TextServer::shaped_text_get_line_breaks(RID p_shaped, float p_w
continue;
}
if (l_gl[i].count > 0) {
- //Ignore trailing spaces.
- bool is_space = (l_gl[i].flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE;
- if ((p_width > 0) && (width + (is_space ? 0 : l_gl[i].advance) > p_width) && (last_safe_break >= 0)) {
+ if ((p_width > 0) && (width + l_gl[i].advance * l_gl[i].repeat > p_width) && (last_safe_break >= 0)) {
lines.push_back(Vector2i(line_start, l_gl[last_safe_break].end));
line_start = l_gl[last_safe_break].end;
i = last_safe_break;
@@ -698,7 +696,7 @@ Vector<Vector2i> TextServer::shaped_text_get_line_breaks(RID p_shaped, float p_w
last_safe_break = i;
}
}
- width += l_gl[i].advance;
+ width += l_gl[i].advance * l_gl[i].repeat;
}
if (l_size > 0) {