1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fixed offset (#8376)

This commit is contained in:
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

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 }