diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-12 18:02:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 18:02:21 +0200 |
commit | 6dfea347b0f957e2689a127f025988f9aae1ab71 (patch) | |
tree | 1d0aac0dac1731c447bd906f42b2295ee6591d04 | |
parent | 561438c5f67fcd2b4a3132d36b32333e4d8eb6c5 (diff) | |
parent | 72ab355945507cc3cbd9d7b16ad0b851e72b98b3 (diff) |
Merge pull request #38655 from ice-blaze/minimap-shifted-selection-by-one-line#38532
Fix minimap selection offset
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 132ee0f249..e986e350f3 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -941,7 +941,7 @@ void TextEdit::_notification(int p_what) { // calculate viewport size and y offset int viewport_height = (draw_amount - 1) * minimap_line_height; int control_height = _get_control_height() - viewport_height; - int viewport_offset_y = round(get_scroll_pos_for_line(first_visible_line) * control_height) / ((v_scroll->get_max() <= minimap_visible_lines) ? (minimap_visible_lines - draw_amount) : (v_scroll->get_max() - draw_amount)); + int viewport_offset_y = round(get_scroll_pos_for_line(first_visible_line + 1) * control_height) / ((v_scroll->get_max() <= minimap_visible_lines) ? (minimap_visible_lines - draw_amount) : (v_scroll->get_max() - draw_amount)); // calculate the first line. int num_lines_before = round((viewport_offset_y) / minimap_line_height); |