Merge pull request #83286 from bronsonholden/fix-text-edit-hscroll-jitter
Remove vertical scrollbar padding from line width calc
This commit is contained in:
commit
3e8dc9df0a
|
@ -7340,7 +7340,7 @@ void TextEdit::_update_scrollbars() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int visible_width = size.width - theme_cache.style_normal->get_minimum_size().width;
|
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) {
|
if (draw_minimap) {
|
||||||
total_width += minimap_width;
|
total_width += minimap_width;
|
||||||
|
|
|
@ -3913,7 +3913,8 @@ TEST_CASE("[SceneTree][TextEdit] viewport") {
|
||||||
CHECK(text_edit->get_h_scroll() == 0);
|
CHECK(text_edit->get_h_scroll() == 0);
|
||||||
|
|
||||||
text_edit->set_h_scroll(10000000);
|
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);
|
text_edit->set_h_scroll(-100);
|
||||||
CHECK(text_edit->get_h_scroll() == 0);
|
CHECK(text_edit->get_h_scroll() == 0);
|
||||||
|
|
Loading…
Reference in New Issue