Merge pull request #83286 from bronsonholden/fix-text-edit-hscroll-jitter

Remove vertical scrollbar padding from line width calc
This commit is contained in:
Rémi Verschelde 2023-10-17 16:12:58 +02:00
commit 3e8dc9df0a
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 3 additions and 2 deletions

View file

@ -7340,7 +7340,7 @@ void TextEdit::_update_scrollbars() {
}
int visible_width = size.width - theme_cache.style_normal->get_minimum_size().width;
int total_width = (draw_placeholder ? placeholder_max_width : text.get_max_width()) + vmin.x + gutters_width + gutter_padding;
int total_width = (draw_placeholder ? placeholder_max_width : text.get_max_width()) + gutters_width + gutter_padding;
if (draw_minimap) {
total_width += minimap_width;

View file

@ -3913,7 +3913,8 @@ TEST_CASE("[SceneTree][TextEdit] viewport") {
CHECK(text_edit->get_h_scroll() == 0);
text_edit->set_h_scroll(10000000);
CHECK(text_edit->get_h_scroll() == 314);
CHECK(text_edit->get_h_scroll() == 306);
CHECK(text_edit->get_h_scroll_bar()->get_combined_minimum_size().x == 8);
text_edit->set_h_scroll(-100);
CHECK(text_edit->get_h_scroll() == 0);