| 1503 | } |
| 1504 | |
| 1505 | void ModularSynth::MousePressed(int intX, int intY, int button, const juce::MouseInputSource& source) |
| 1506 | { |
| 1507 | bool rightButton = button == 2; |
| 1508 | |
| 1509 | mZoomer.ExitVanityPanningMode(); |
| 1510 | |
| 1511 | mMousePos.x = intX; |
| 1512 | mMousePos.y = intY; |
| 1513 | mLastClickWasEmptySpace = false; |
| 1514 | |
| 1515 | if (button >= 0 && button < (int)mIsMouseButtonHeld.size()) |
| 1516 | mIsMouseButtonHeld[button] = true; |
| 1517 | |
| 1518 | float x = GetMouseX(&mModuleContainer); |
| 1519 | float y = GetMouseY(&mModuleContainer); |
| 1520 | |
| 1521 | mLastMouseDragPos = ofVec2f(x, y); |
| 1522 | mGroupSelectContext = nullptr; |
| 1523 | |
| 1524 | IKeyboardFocusListener::sKeyboardFocusBeforeClick = IKeyboardFocusListener::GetActiveKeyboardFocus(); |
| 1525 | IKeyboardFocusListener::ClearActiveKeyboardFocus(K(notifyListeners)); |
| 1526 | |
| 1527 | if (button == 3) |
| 1528 | { |
| 1529 | mClickStartX = x; |
| 1530 | mClickStartY = y; |
| 1531 | mIsMousePanning = true; |
| 1532 | return; |
| 1533 | } |
| 1534 | |
| 1535 | if (PatchCable::sActivePatchCable != nullptr) |
| 1536 | { |
| 1537 | if (rightButton) |
| 1538 | PatchCable::sActivePatchCable->Destroy(true); |
| 1539 | return; |
| 1540 | } |
| 1541 | |
| 1542 | if (mMoveModule) |
| 1543 | { |
| 1544 | mMoveModule = nullptr; |
| 1545 | return; |
| 1546 | } |
| 1547 | |
| 1548 | if (InMidiMapMode()) |
| 1549 | { |
| 1550 | if (gBindToUIControl == gHoveredUIControl) //if it's the same, clear it |
| 1551 | gBindToUIControl = nullptr; |
| 1552 | else |
| 1553 | gBindToUIControl = gHoveredUIControl; |
| 1554 | return; |
| 1555 | } |
| 1556 | |
| 1557 | IDrawableModule* hoveredUIControlModuleParent = nullptr; |
| 1558 | if (gHoveredUIControl != nullptr) |
| 1559 | hoveredUIControlModuleParent = gHoveredUIControl->GetModuleParent(); |
| 1560 | |
| 1561 | if (hoveredUIControlModuleParent != nullptr && !hoveredUIControlModuleParent->IsDeleted() && !hoveredUIControlModuleParent->IsHoveringOverResizeHandle() && |
| 1562 | !IUIControl::WasLastHoverSetManually() && |
no test coverage detected