From bf5b088a540b1da29f4194bf5ed021358decfe97 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 10 Nov 2022 17:27:50 -0500 Subject: [PATCH] GUI: "fix" piano being clickable under windows --- src/gui/piano.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index 1e606d77..a100e3ba 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -219,11 +219,14 @@ void FurnaceGUI::drawPiano() { // render piano //ImGui::ItemSize(size,ImGui::GetStyle().FramePadding.y); if (ImGui::ItemAdd(rect,ImGui::GetID("pianoDisplay"))) { - ImGui::ItemHoverable(rect,ImGui::GetID("pianoDisplay")); + bool canInput=false; + if (ImGui::ItemHoverable(rect,ImGui::GetID("pianoDisplay"))) { + canInput=true; + } if (view) { int notes=oct*12; // evaluate input - for (TouchPoint& i: activePoints) { + if (canInput) for (TouchPoint& i: activePoints) { if (rect.Contains(ImVec2(i.x,i.y))) { int note=(((i.x-rect.Min.x)/(rect.Max.x-rect.Min.x))*notes)+12*off; if (note<0) continue;