diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 71d88420f5..047f8a1780 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -298,7 +298,7 @@ struct IConsoleWindow : Window int delta = std::min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); Point p1 = GetCharPosInString(_iconsole_cmdline.buf, from, FS_NORMAL); - Point p2 = from != to ? GetCharPosInString(_iconsole_cmdline.buf, from) : p1; + Point p2 = from != to ? GetCharPosInString(_iconsole_cmdline.buf, to, FS_NORMAL) : p1; Rect r = {this->line_offset + delta + p1.x, this->height - this->line_height, this->line_offset + delta + p2.x, this->height}; return r;