GUI: "fix" piano being clickable under windows

This commit is contained in:
tildearrow 2022-11-10 17:27:50 -05:00
parent 692d95664a
commit bf5b088a54
1 changed files with 5 additions and 2 deletions

View File

@ -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;