mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-15 15:14:16 +00:00
[lua] Fix mouse position to client coordinates on mouse events
This commit is contained in:
parent
b42a8b7ecf
commit
8b390d56fd
@ -927,10 +927,10 @@ int Dialog_canvas(lua_State* L)
|
|||||||
|
|
||||||
auto mouseCallback =
|
auto mouseCallback =
|
||||||
[](lua_State* L, ui::MouseMessage* msg) {
|
[](lua_State* L, ui::MouseMessage* msg) {
|
||||||
lua_pushinteger(L, msg->position().x);
|
lua_pushinteger(L, msg->position().x - msg->recipient()->bounds().x);
|
||||||
lua_setfield(L, -2, "x");
|
lua_setfield(L, -2, "x");
|
||||||
|
|
||||||
lua_pushinteger(L, msg->position().y);
|
lua_pushinteger(L, msg->position().y - msg->recipient()->bounds().y);
|
||||||
lua_setfield(L, -2, "y");
|
lua_setfield(L, -2, "y");
|
||||||
|
|
||||||
lua_pushinteger(L, int(msg->button()));
|
lua_pushinteger(L, int(msg->button()));
|
||||||
|
Loading…
Reference in New Issue
Block a user