mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
fix: scrollbar range fix and new tests for the same
fix: now the scrollbar also should work within the range it is provided adjusted the tests according to the new scrollbar functinality attempted to fix testcases for scrollbar
This commit is contained in:
@@ -6587,7 +6587,7 @@ void TextEdit::set_line_as_last_visible(int p_line, int p_wrap_index) {
|
||||
set_v_scroll(0);
|
||||
return;
|
||||
}
|
||||
set_v_scroll(Math::round(get_scroll_pos_for_line(first_line, next_line.y) + _get_visible_lines_offset()));
|
||||
set_v_scroll(get_scroll_pos_for_line(first_line, next_line.y) + _get_visible_lines_offset());
|
||||
}
|
||||
|
||||
int TextEdit::get_last_full_visible_line() const {
|
||||
@@ -8616,9 +8616,12 @@ void TextEdit::_update_scrollbars() {
|
||||
updating_scrolls = true;
|
||||
|
||||
if (!fit_content_height && total_rows > visible_rows) {
|
||||
double visible_rows_exact = (double)_get_control_height() / (double)get_line_height();
|
||||
double fractional_visible_rows = visible_rows_exact - (double)visible_rows;
|
||||
fractional_visible_rows = CLAMP(fractional_visible_rows, 0.0, 1.0);
|
||||
v_scroll->show();
|
||||
v_scroll->set_max(total_rows + _get_visible_lines_offset());
|
||||
v_scroll->set_page(visible_rows + _get_visible_lines_offset());
|
||||
v_scroll->set_max(total_rows);
|
||||
v_scroll->set_page(visible_rows + fractional_visible_rows);
|
||||
set_v_scroll(get_v_scroll());
|
||||
} else {
|
||||
first_visible_line = 0;
|
||||
|
||||
Reference in New Issue
Block a user