MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / MousePressed

Method MousePressed

Source/ModularSynth.cpp:1505–1696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1503}
1504
1505void 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() &&

Callers 1

mouseDownMethod · 0.80

Calls 15

ofVec2fClass · 0.85
VectorContainsFunction · 0.85
ExitVanityPanningModeMethod · 0.80
sizeMethod · 0.80
DestroyMethod · 0.80
GetModuleParentMethod · 0.80
IsDeletedMethod · 0.80
emptyMethod · 0.80
IsShowingMethod · 0.80
GetOwningContainerMethod · 0.80
GetParentMethod · 0.80

Tested by

no test coverage detected