mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-31 00:32:48 +00:00
Fix crash double clicking a Dialog:canvas()
There were missing some setRecipient() when some messages are converted to other kind of message (e.g. DoubleClick -> MouseDown)
This commit is contained in:
parent
789e857d98
commit
d4cefb8ba6
@ -927,6 +927,10 @@ int Dialog_canvas(lua_State* L)
|
|||||||
|
|
||||||
auto mouseCallback =
|
auto mouseCallback =
|
||||||
[](lua_State* L, ui::MouseMessage* msg) {
|
[](lua_State* L, ui::MouseMessage* msg) {
|
||||||
|
ASSERT(msg->recipient());
|
||||||
|
if (!msg->recipient())
|
||||||
|
return;
|
||||||
|
|
||||||
lua_pushinteger(L, msg->position().x - msg->recipient()->bounds().x);
|
lua_pushinteger(L, msg->position().x - msg->recipient()->bounds().x);
|
||||||
lua_setfield(L, -2, "x");
|
lua_setfield(L, -2, "x");
|
||||||
|
|
||||||
|
@ -538,6 +538,7 @@ bool ComboBoxEntry::onProcessMessage(Message* msg)
|
|||||||
kMouseDownMessage,
|
kMouseDownMessage,
|
||||||
*mouseMsg,
|
*mouseMsg,
|
||||||
mouseMsg->positionForDisplay(pick->display()));
|
mouseMsg->positionForDisplay(pick->display()));
|
||||||
|
mouseMsg2.setRecipient(pick);
|
||||||
mouseMsg2.setDisplay(pick->display());
|
mouseMsg2.setDisplay(pick->display());
|
||||||
pick->sendMessage(&mouseMsg2);
|
pick->sendMessage(&mouseMsg2);
|
||||||
return true;
|
return true;
|
||||||
|
@ -98,6 +98,7 @@ bool IntEntry::onProcessMessage(Message* msg)
|
|||||||
MouseMessage mouseMsg2(kMouseDownMessage,
|
MouseMessage mouseMsg2(kMouseDownMessage,
|
||||||
*mouseMsg,
|
*mouseMsg,
|
||||||
mouseMsg->positionForDisplay(pick->display()));
|
mouseMsg->positionForDisplay(pick->display()));
|
||||||
|
mouseMsg2.setRecipient(pick);
|
||||||
mouseMsg2.setDisplay(pick->display());
|
mouseMsg2.setDisplay(pick->display());
|
||||||
pick->sendMessage(&mouseMsg2);
|
pick->sendMessage(&mouseMsg2);
|
||||||
}
|
}
|
||||||
|
@ -1557,6 +1557,7 @@ bool Widget::onProcessMessage(Message* msg)
|
|||||||
MouseMessage mouseMsg2(kMouseDownMessage,
|
MouseMessage mouseMsg2(kMouseDownMessage,
|
||||||
*mouseMsg,
|
*mouseMsg,
|
||||||
mouseMsg->position());
|
mouseMsg->position());
|
||||||
|
mouseMsg2.setRecipient(this);
|
||||||
mouseMsg2.setDisplay(mouseMsg->display());
|
mouseMsg2.setDisplay(mouseMsg->display());
|
||||||
sendMessage(&mouseMsg2);
|
sendMessage(&mouseMsg2);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user