diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-15 17:35:44 +0100 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-15 17:35:44 +0100 |
| commit | 7e14974d075f115faa11c328d4d12169d565c451 (patch) | |
| tree | f1ca9aa3f5d5363220430c3c958d582ee0d308fd | |
| parent | 4bb3af67e0903f024a5ede048248559df6ff2d3e (diff) | |
| parent | 1a5bae9adc8842afe5c9458f3fbc317431e8768d (diff) | |
| download | redot-engine-7e14974d075f115faa11c328d4d12169d565c451.tar.gz | |
Merge pull request #88185 from bruvzg/font_draw_no_ellipsis
[Font] Do not use trim with ellipsis in the basic Font string drawing functions.
| -rw-r--r-- | scene/resources/font.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 4df7dc9912..7bf2d857de 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -288,6 +288,7 @@ Size2 Font::get_string_size(const String &p_text, HorizontalAlignment p_alignmen buffer.instantiate(); buffer->set_direction(p_direction); buffer->set_orientation(p_orientation); + buffer->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_CHAR); buffer->add_string(p_text, Ref<Font>(this), p_font_size); cache.insert(key, buffer); } @@ -315,6 +316,7 @@ Size2 Font::get_multiline_string_size(const String &p_text, HorizontalAlignment lines_buffer->set_width(p_width); lines_buffer->set_break_flags(p_brk_flags); lines_buffer->set_justification_flags(p_jst_flags); + lines_buffer->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_CHAR); cache_wrap.insert(key, lines_buffer); } @@ -335,6 +337,7 @@ void Font::draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_t buffer.instantiate(); buffer->set_direction(p_direction); buffer->set_orientation(p_orientation); + buffer->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_CHAR); buffer->add_string(p_text, Ref<Font>(this), p_font_size); cache.insert(key, buffer); } @@ -369,6 +372,7 @@ void Font::draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const S lines_buffer->set_width(p_width); lines_buffer->set_break_flags(p_brk_flags); lines_buffer->set_justification_flags(p_jst_flags); + lines_buffer->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_CHAR); cache_wrap.insert(key, lines_buffer); } @@ -396,6 +400,7 @@ void Font::draw_string_outline(RID p_canvas_item, const Point2 &p_pos, const Str buffer.instantiate(); buffer->set_direction(p_direction); buffer->set_orientation(p_orientation); + buffer->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_CHAR); buffer->add_string(p_text, Ref<Font>(this), p_font_size); cache.insert(key, buffer); } @@ -430,6 +435,7 @@ void Font::draw_multiline_string_outline(RID p_canvas_item, const Point2 &p_pos, lines_buffer->set_width(p_width); lines_buffer->set_break_flags(p_brk_flags); lines_buffer->set_justification_flags(p_jst_flags); + lines_buffer->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_CHAR); cache_wrap.insert(key, lines_buffer); } |
