diff options
Diffstat (limited to 'scene/gui/rich_text_label.cpp')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 3b0425b223..5abb6c1d01 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -719,7 +719,7 @@ void RichTextLabel::_input_event(InputEvent p_event) { case InputEvent::KEY: { const InputEventKey &k=p_event.key; - if (k.pressed && !k.mod.alt && !k.mod.shift && !k.mod.command && !k.mod.meta) { + if (k.pressed && !k.mod.alt && !k.mod.shift && !k.mod.meta) { bool handled=true; switch(k.scancode) { case KEY_PAGEUP: { @@ -1504,7 +1504,6 @@ Error RichTextLabel::append_bbcode(const String& p_bbcode) { void RichTextLabel::scroll_to_line(int p_line) { - p_line -= 1; ERR_FAIL_INDEX(p_line,lines.size()); _validate_line_caches(); vscroll->set_val(lines[p_line].height_accum_cache-lines[p_line].height_cache); @@ -1572,11 +1571,8 @@ bool RichTextLabel::search(const String& p_string,bool p_from_selection) { } - if (line > 1) { - line-=1; - } - - scroll_to_line(line); + line-=2; + scroll_to_line(line<0?0:line); return true; } |