mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +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 =
|
||||
[](lua_State* L, ui::MouseMessage* msg) {
|
||||
ASSERT(msg->recipient());
|
||||
if (!msg->recipient())
|
||||
return;
|
||||
|
||||
lua_pushinteger(L, msg->position().x - msg->recipient()->bounds().x);
|
||||
lua_setfield(L, -2, "x");
|
||||
|
||||
|
@ -538,6 +538,7 @@ bool ComboBoxEntry::onProcessMessage(Message* msg)
|
||||
kMouseDownMessage,
|
||||
*mouseMsg,
|
||||
mouseMsg->positionForDisplay(pick->display()));
|
||||
mouseMsg2.setRecipient(pick);
|
||||
mouseMsg2.setDisplay(pick->display());
|
||||
pick->sendMessage(&mouseMsg2);
|
||||
return true;
|
||||
|
@ -98,6 +98,7 @@ bool IntEntry::onProcessMessage(Message* msg)
|
||||
MouseMessage mouseMsg2(kMouseDownMessage,
|
||||
*mouseMsg,
|
||||
mouseMsg->positionForDisplay(pick->display()));
|
||||
mouseMsg2.setRecipient(pick);
|
||||
mouseMsg2.setDisplay(pick->display());
|
||||
pick->sendMessage(&mouseMsg2);
|
||||
}
|
||||
|
@ -1557,6 +1557,7 @@ bool Widget::onProcessMessage(Message* msg)
|
||||
MouseMessage mouseMsg2(kMouseDownMessage,
|
||||
*mouseMsg,
|
||||
mouseMsg->position());
|
||||
mouseMsg2.setRecipient(this);
|
||||
mouseMsg2.setDisplay(mouseMsg->display());
|
||||
sendMessage(&mouseMsg2);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user