diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/file_dialog.cpp | 5 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 320dad9301..d8ff048dfb 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -115,7 +115,9 @@ Vector<String> FileDialog::get_selected_files() const { void FileDialog::update_dir() { dir->set_text(dir_access->get_current_dir()); - drives->select(dir_access->get_current_drive()); + if (drives->is_visible()) { + drives->select(dir_access->get_current_drive()); + } } void FileDialog::_dir_entered(String p_dir) { @@ -667,7 +669,6 @@ void FileDialog::_update_drives() { drives->show(); for (int i = 0; i < dir_access->get_drive_count(); i++) { - String d = dir_access->get_drive(i); drives->add_item(dir_access->get_drive(i)); } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index d14d3ef947..33c29547be 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4287,6 +4287,14 @@ int TextEdit::get_v_scroll() const { } void TextEdit::set_v_scroll(int p_scroll) { + if (p_scroll < 0) { + p_scroll = 0; + } + if (!scroll_past_end_of_file_enabled) { + if (p_scroll + get_visible_rows() > get_line_count()) { + p_scroll = get_line_count() - get_visible_rows(); + } + } v_scroll->set_value(p_scroll); cursor.line_ofs = p_scroll; } |