summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneikeq <ignalfonsore@gmail.com>2015-12-02 10:59:17 +0100
committerneikeq <ignalfonsore@gmail.com>2015-12-02 14:01:46 +0100
commit11b560d6d436a64a54daa5a5c8eb0a460dff7840 (patch)
tree823ef1684b1f97675df67edb7293e2251a3e0617
parentf1f3468f70c85c33f630042670b47401eeee6092 (diff)
Fix help view not scrolling to the top
-rw-r--r--scene/gui/rich_text_label.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 3b0425b223..d9a4d583b8 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -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;
}