diff options
Diffstat (limited to 'scene/gui/rich_text_label.cpp')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 98bc0b9434..786ce27a0c 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -278,6 +278,11 @@ if (m_height > line_height) {\ if (c[end]=='\t') { cw=tab_size*font->get_char_size(' ').width; } + + if (end>0 && w+cw+begin > p_width ) { + break; //don't allow lines longer than assigned width + } + w+=cw; if (c[end]==' ') { @@ -340,10 +345,12 @@ if (m_height > line_height) {\ int cw=font->get_char_size(c[i],c[i+1]).x; + if (c[i]=='\t') { cw=tab_size*font->get_char_size(' ').width; } + if (p_click_pos.x-cw/2>p_ofs.x+align_ofs+pofs) { rchar=int((&c[i])-cf); @@ -374,6 +381,8 @@ if (m_height > line_height) {\ int cw=0; bool visible = visible_characters<0 || p_char_count<visible_characters; + if (c[i]=='\t') + visible=false; if (selected) { |