Skip to content

Commit c44e58e

Browse files
author
ethanblazkowicz
committed
1. Fixed l_SetCursorPos, now it uses the same logic with l_GetCursorPos
1 parent 3235e42 commit c44e58e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ui_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,8 @@ static int l_SetCursorPos(lua_State* L)
14051405
ui->LAssert(L, n >= 2, "Usage: SetCursorPos(x, y)");
14061406
ui->LAssert(L, lua_isnumber(L, 1), "SetCursorPos() argument 1: expected number, got %s", luaL_typename(L, 1));
14071407
ui->LAssert(L, lua_isnumber(L, 2), "SetCursorPos() argument 2: expected number, got %s", luaL_typename(L, 2));
1408-
int x = ui->renderer->VirtualUnmap((int)lua_tointeger(L, 1) * dpiScale);
1409-
int y = ui->renderer->VirtualUnmap((int)lua_tointeger(L, 2) * dpiScale);
1408+
int x = ui->renderer->VirtualUnmap((int)lua_tointeger(L, 1) / dpiScale);
1409+
int y = ui->renderer->VirtualUnmap((int)lua_tointeger(L, 2) / dpiScale);
14101410
ui->sys->video->SetRelativeCursor(x, y);
14111411
return 0;
14121412
}

0 commit comments

Comments
 (0)