diff --git a/src/text_editor/draw.cpp b/src/text_editor/draw.cpp index 1f58324..a9428ce 100644 --- a/src/text_editor/draw.cpp +++ b/src/text_editor/draw.cpp @@ -103,6 +103,7 @@ void DrawUnderline(Window *window, View *view, Buffer *buffer, Range range, Colo Vec2I max = {xy_max.col * window->font->char_spacing, (xy_max.line + 1) * window->font->line_spacing}; Rect2I rect = {min, max}; Rect2I scrolled_rect = rect - view->scroll + window->document_rect.min; + if (scrolled_rect.min.x < window->document_rect.min.x) scrolled_rect.min.x = window->document_rect.min.x; DrawRectOutline(scrolled_rect, color); }