summaryrefslogtreecommitdiffstats
path: root/scene/gui/code_edit.cpp
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2021-07-09 11:52:49 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2021-08-12 09:29:16 +0100
commit7e70f9e0b9696fab55e2d0570c6bdc8b07c14462 (patch)
tree7a5dba0fad93df8d9e3d8c44d7111949d756299b /scene/gui/code_edit.cpp
parentd5dcaee4c5b41faca64f02888b152f7f05c4a20b (diff)
downloadredot-engine-7e70f9e0b9696fab55e2d0570c6bdc8b07c14462.tar.gz
Expose and cleanup TextEdit line wrap API
Diffstat (limited to 'scene/gui/code_edit.cpp')
-rw-r--r--scene/gui/code_edit.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp
index 1e2d601bde..6528e90f30 100644
--- a/scene/gui/code_edit.cpp
+++ b/scene/gui/code_edit.cpp
@@ -295,8 +295,8 @@ void CodeEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (mb->get_button_index() == MOUSE_BUTTON_LEFT) {
if (is_line_folded(line)) {
- int wrap_index = get_line_wrap_index_at_col(line, col);
- if (wrap_index == times_line_wraps(line)) {
+ int wrap_index = get_line_wrap_index_at_column(line, col);
+ if (wrap_index == get_line_wrap_count(line)) {
int eol_icon_width = cache.folded_eol_icon->get_width();
int left_margin = get_total_gutter_width() + eol_icon_width + get_line_width(line, wrap_index) - get_h_scroll();
if (mpos.x > left_margin && mpos.x <= left_margin + eol_icon_width + 3) {
@@ -531,8 +531,8 @@ Control::CursorShape CodeEdit::get_cursor_shape(const Point2 &p_pos) const {
_get_mouse_pos(p_pos, line, col);
if (is_line_folded(line)) {
- int wrap_index = get_line_wrap_index_at_col(line, col);
- if (wrap_index == times_line_wraps(line)) {
+ int wrap_index = get_line_wrap_index_at_column(line, col);
+ if (wrap_index == get_line_wrap_count(line)) {
int eol_icon_width = cache.folded_eol_icon->get_width();
int left_margin = get_total_gutter_width() + eol_icon_width + get_line_width(line, wrap_index) - get_h_scroll();
if (p_pos.x > left_margin && p_pos.x <= left_margin + eol_icon_width + 3) {