Browse Source

Fix mouse up event for imgui based widgets

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 3 years ago
parent
commit
e0f12a9998
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 2 additions and 6 deletions
  1. +1
    -5
      plugins/Cardinal/src/ImGuiWidget.cpp
  2. +1
    -1
      plugins/Cardinal/src/ImGuiWidget.hpp

+ 1
- 5
plugins/Cardinal/src/ImGuiWidget.cpp View File

@@ -270,16 +270,12 @@ void ImGuiWidget::onDragHover(const DragHoverEvent& e)
}
}

void ImGuiWidget::onDragLeave(const DragLeaveEvent& e)
void ImGuiWidget::onDragEnd(const DragEndEvent& e)
{
ImGui::SetCurrentContext(imData->context);

// FIXME this is not the correct event..
ImGuiIO& io(ImGui::GetIO());
io.MouseDown[0] = io.MouseDown[1] = io.MouseDown[2] = false;

if (io.WantCaptureMouse)
e.consume(this);
}

void ImGuiWidget::onHoverScroll(const HoverScrollEvent& e)


+ 1
- 1
plugins/Cardinal/src/ImGuiWidget.hpp View File

@@ -34,7 +34,7 @@ protected:
void onContextDestroy(const ContextDestroyEvent& e) override;
void onHover(const HoverEvent& e) override;
void onDragHover(const DragHoverEvent& e) override;
void onDragLeave(const DragLeaveEvent& e) override;
void onDragEnd(const DragEndEvent& e) override;
void onHoverScroll(const HoverScrollEvent& e) override;
void onButton(const ButtonEvent& e) override;
void onSelectKey(const SelectKeyEvent& e) override;


Loading…
Cancel
Save