diff options
author | cflip <cflip@cflip.net> | 2023-01-17 20:52:50 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-17 20:52:50 -0700 |
commit | 3a305e2b1cec96a9aba65d2d895e65e06747406f (patch) | |
tree | fbfc52ed96e0bd0b5402c66d2a1d2605a6b85d09 | |
parent | a40638b63deeb27301d56db7426fba56850927ca (diff) |
Fix cursor rendering when view is scrolled horizontally
-rw-r--r-- | window.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -118,7 +118,7 @@ void window_redraw(struct editor_state *editor) draw_font_text(&buffer); SDL_Rect cursor_rect; - cursor_rect.x = editor->cursor_display_x * font.width; + cursor_rect.x = (editor->cursor_display_x - editor->col_offset) * font.width; cursor_rect.y = (editor->cursor_y - editor->line_offset) * font.height; cursor_rect.w = font.width; cursor_rect.h = font.height; |