GUI: "fix" piano being clickable under windows
This commit is contained in:
parent
692d95664a
commit
bf5b088a54
|
@ -219,11 +219,14 @@ void FurnaceGUI::drawPiano() {
|
||||||
// render piano
|
// render piano
|
||||||
//ImGui::ItemSize(size,ImGui::GetStyle().FramePadding.y);
|
//ImGui::ItemSize(size,ImGui::GetStyle().FramePadding.y);
|
||||||
if (ImGui::ItemAdd(rect,ImGui::GetID("pianoDisplay"))) {
|
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) {
|
if (view) {
|
||||||
int notes=oct*12;
|
int notes=oct*12;
|
||||||
// evaluate input
|
// evaluate input
|
||||||
for (TouchPoint& i: activePoints) {
|
if (canInput) for (TouchPoint& i: activePoints) {
|
||||||
if (rect.Contains(ImVec2(i.x,i.y))) {
|
if (rect.Contains(ImVec2(i.x,i.y))) {
|
||||||
int note=(((i.x-rect.Min.x)/(rect.Max.x-rect.Min.x))*notes)+12*off;
|
int note=(((i.x-rect.Min.x)/(rect.Max.x-rect.Min.x))*notes)+12*off;
|
||||||
if (note<0) continue;
|
if (note<0) continue;
|
||||||
|
|
Loading…
Reference in New Issue