summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2018-10-04 19:38:08 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2018-10-04 19:38:08 -0300
commit8a64a44e0efa466de4d359aeae2398b5337a8da9 (patch)
tree87a861c7ab683782523b5994c01062aee57c3799 /scene/gui
parent8068d0217a5e74c25f83fe93fa6e077b8d0b3bf5 (diff)
Fix TextEdit margin start spacing with two scrollbars
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/text_edit.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index c390c60a8c..bbd9369547 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -334,15 +334,12 @@ void TextEdit::_update_scrollbars() {
h_scroll->set_begin(Point2(0, size.height - hmin.height));
h_scroll->set_end(Point2(size.width - vmin.width, size.height));
- int hscroll_rows = ((hmin.height - 1) / get_row_height()) + 1;
int visible_rows = get_visible_rows();
-
int total_rows = get_total_visible_rows();
if (scroll_past_end_of_file_enabled) {
total_rows += visible_rows - 1;
}
- int vscroll_pixels = v_scroll->get_combined_minimum_size().width;
int visible_width = size.width - cache.style_normal->get_minimum_size().width;
int total_width = text.get_max_width(true) + vmin.x;
@@ -367,12 +364,12 @@ void TextEdit::_update_scrollbars() {
} else {
- if (total_rows > visible_rows && total_width <= visible_width - vscroll_pixels) {
+ if (total_rows > visible_rows && total_width <= visible_width) {
//thanks yessopie for this clever bit of logic
use_hscroll = false;
}
- if (total_rows <= visible_rows - hscroll_rows && total_width > visible_width) {
+ if (total_rows <= visible_rows && total_width > visible_width) {
//thanks yessopie for this clever bit of logic
use_vscroll = false;
}