fixed offset (#8376)

pull/8381/head
shadowninja55 2021-01-27 12:39:53 -05:00 committed by GitHub
parent d1ab22d45f
commit fccd4f98d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 }