From 3faa50165c9770c2c80cf00cb3b5a33a85beb4e2 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Fri, 7 Dec 2018 07:11:00 +0100 Subject: [PATCH] update imgui and clean up the allegro5 impl --- src/3rdparty/cimgui | 2 +- src/imgui/imgui_impl_allegro5.c | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/3rdparty/cimgui b/src/3rdparty/cimgui index e5ac5a2..67f3b09 160000 --- a/src/3rdparty/cimgui +++ b/src/3rdparty/cimgui @@ -1 +1 @@ -Subproject commit e5ac5a203bbf47e120ef4cd773071f4d7274a70d +Subproject commit 67f3b097a5090dd074be959fb9c794bd75096a1c diff --git a/src/imgui/imgui_impl_allegro5.c b/src/imgui/imgui_impl_allegro5.c index 3a47ffa..052ebf6 100644 --- a/src/imgui/imgui_impl_allegro5.c +++ b/src/imgui/imgui_impl_allegro5.c @@ -277,17 +277,9 @@ SYMBOL_INTERNAL bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* ev) { } return true; case ALLEGRO_EVENT_MOUSE_BUTTON_DOWN: - if (ev->mouse.display == g_Display) { - if (ev->mouse.button <= 5) { - io->MouseDown[ev->mouse.button - 1] = true; - } - } - return true; case ALLEGRO_EVENT_MOUSE_BUTTON_UP: - if (ev->mouse.display == g_Display) { - if (ev->mouse.button <= 5) { - io->MouseDown[ev->mouse.button - 1] = false; - } + if (ev->mouse.display == g_Display && ev->mouse.button <= 5) { + io->MouseDown[ev->mouse.button - 1] = (ev->type == ALLEGRO_EVENT_MOUSE_BUTTON_DOWN); } return true; case ALLEGRO_EVENT_TOUCH_MOVE: @@ -296,14 +288,10 @@ SYMBOL_INTERNAL bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* ev) { } return true; case ALLEGRO_EVENT_TOUCH_BEGIN: - if (ev->touch.display == g_Display) { - io->MouseDown[0] = true; - } - return true; case ALLEGRO_EVENT_TOUCH_END: case ALLEGRO_EVENT_TOUCH_CANCEL: - if (ev->touch.display == g_Display) { - io->MouseDown[0] = false; + if (ev->touch.display == g_Display && ev->touch.primary) { + io->MouseDown[0] = (ev->type == ALLEGRO_EVENT_TOUCH_BEGIN); } return true; case ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY: