From fccd4f98d52576afe9e2fe91b78564d01e4bfa55 Mon Sep 17 00:00:00 2001 From: shadowninja55 <49539636+shadowninja55@users.noreply.github.com> Date: Wed, 27 Jan 2021 12:39:53 -0500 Subject: [PATCH] fixed offset (#8376) --- vlib/term/ui/input_windows.c.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/term/ui/input_windows.c.v b/vlib/term/ui/input_windows.c.v index e2b96806ae..c87f314b80 100644 --- a/vlib/term/ui/input_windows.c.v +++ b/vlib/term/ui/input_windows.c.v @@ -186,8 +186,8 @@ fn (mut ctx Context) parse_events() { if !C.GetConsoleScreenBufferInfo(ctx.stdout_handle, &sb_info) { panic('could not get screenbuffer info') } - x := e.dwMousePosition.X - y := int(e.dwMousePosition.Y) - sb_info.srWindow.Top + x := e.dwMousePosition.X + 1 + y := int(e.dwMousePosition.Y) - sb_info.srWindow.Top + 1 mut modifiers := u32(0) if e.dwControlKeyState & (0x1 | 0x2) != 0 { modifiers |= alt } if e.dwControlKeyState & (0x4 | 0x8) != 0 { modifiers |= ctrl }