diff --git a/src/gui/newPattern.cpp b/src/gui/newPattern.cpp index a9cf97edf..a88142cf7 100644 --- a/src/gui/newPattern.cpp +++ b/src/gui/newPattern.cpp @@ -1058,6 +1058,12 @@ void FurnaceGUI::drawPatternNew() { } } + bool hovered=( + pointer.xCoarse>=0 && pointer.y>=0 && pointer.order>=0 && + ImGui::IsWindowHovered() && + ImRect(dl->GetClipRectMin(),dl->GetClipRectMax()).Contains(ImGui::GetMousePos()) + ); + String debugText=fmt::sprintf( "NPR DEBUG (xC:xF, o/y)\n" "pointer: %d:%d, %d/%d\n" @@ -1177,29 +1183,35 @@ void FurnaceGUI::drawPatternNew() { // cursor background if (cursor.xCoarse>=0 && cursor.xCoarseAddRectFilled( - ImVec2(top.x+patChanX[cursor.xCoarse]+patFineOffsets[cursor.xFine&31],pos.y), - ImVec2(top.x+patChanX[cursor.xCoarse]+patFineOffsets[(1+cursor.xFine)&31],pos.y+lineHeight), - ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_PATTERN_CURSOR]) - ); - break; - } + if (e->curSubSong->chanShow[cursor.xCoarse]) { + int ord=firstOrd; + int row=firstRow; + pos=top; + SETUP_ORDER_ALPHA; + for (int j=0; jAddRectFilled( + ImVec2(top.x+patChanX[cursor.xCoarse]+patFineOffsets[cursor.xFine&31],pos.y), + ImVec2(top.x+patChanX[cursor.xCoarse]+patFineOffsets[(1+cursor.xFine)&31],pos.y+lineHeight), + (hovered && pointer.xCoarse==cursor.xCoarse && pointer.xFine==cursor.xFine && pointer.y==cursor.y && pointer.order==cursor.order)? + ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]): + ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_PATTERN_CURSOR]) + ); + break; + } - if (++row>=e->curSubSong->patLen) { - row=0; - ord++; - SETUP_ORDER_ALPHA; + if (++row>=e->curSubSong->patLen) { + row=0; + ord++; + SETUP_ORDER_ALPHA; + } + pos.y+=lineHeight; } - pos.y+=lineHeight; } } + // hover background + // channels and borders bool isFirstChan=true; for (int i=0; i=0 && pointer.y>=0 && pointer.order>=0) { - if (ImGui::IsWindowHovered()) { - if (ImRect(dl->GetClipRectMin(),dl->GetClipRectMax()).Contains(ImGui::GetMousePos())) { - //dl->AddText(top+ImVec2(0,lineHeight)+ImGui::GetCurrentWindow()->Scroll,0xffffffff,"Hovered!!!!!!!"); - if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) { - startSelection(pointer.xCoarse,pointer.xFine,pointer.y,pointer.order); - } + if (hovered) { + //dl->AddText(top+ImVec2(0,lineHeight)+ImGui::GetCurrentWindow()->Scroll,0xffffffff,"Hovered!!!!!!!"); + if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) { + startSelection(pointer.xCoarse,pointer.xFine,pointer.y,pointer.order); + } - updateSelection(pointer.xCoarse,pointer.xFine,pointer.y,pointer.order); + updateSelection(pointer.xCoarse,pointer.xFine,pointer.y,pointer.order); - if (ImGui::IsMouseDown(ImGuiMouseButton_Left) && CHECK_LONG_HOLD) { - ImGui::InhibitInertialScroll(); - NOTIFY_LONG_HOLD; - mobilePatSel=true; - } - } + if (ImGui::IsMouseDown(ImGuiMouseButton_Left) && CHECK_LONG_HOLD) { + ImGui::InhibitInertialScroll(); + NOTIFY_LONG_HOLD; + mobilePatSel=true; } } }