Fix ui::selector handling mouse click event
This commit is contained in:
parent
e630316a05
commit
976b493e2b
1 changed files with 3 additions and 2 deletions
|
|
@ -88,9 +88,10 @@ namespace psemek::ui
|
|||
|
||||
bool selector::on_event(mouse_click const & e)
|
||||
{
|
||||
if (e.down && e.button == mouse_button::left && selected_ && callback_)
|
||||
if (e.down && e.button == mouse_button::left && selected_)
|
||||
{
|
||||
post([cb = callback_, i = *selected_]{ cb(i); });
|
||||
if (callback_)
|
||||
post([cb = callback_, i = *selected_]{ cb(i); });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue