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

Method MouseMoved

Source/PatchCableSource.cpp:461–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461bool PatchCableSource::MouseMoved(float x, float y)
462{
463 if (!Enabled())
464 return false;
465
466 if (!mClickable)
467 return false;
468
469 x = TheSynth->GetMouseX(mOwner->GetOwningContainer());
470 y = TheSynth->GetMouseY(mOwner->GetOwningContainer());
471
472 mHoverIndex = GetHoverIndex(x, y);
473
474 if (mHoverIndex != -1 && gHoveredUIControl != nullptr)
475 {
476 if (gHoveredUIControl->IsMouseDown())
477 mHoverIndex = -1; //if we're dragging a control, don't show cables bubbling out
478 else
479 gHoveredUIControl = nullptr; //if we're hovering over a patch cable, get rid of ui control hover
480 }
481
482 for (size_t i = 0; i < mPatchCables.size(); ++i)
483 {
484 if (mPatchCables[i] != nullptr)
485 {
486 mPatchCables[i]->SetHoveringOnSource(i == mHoverIndex);
487 mPatchCables[i]->NotifyMouseMoved(x, y);
488 }
489 }
490
491 return false;
492}
493
494void PatchCableSource::MouseReleased()
495{

Callers

nothing calls this directly

Calls 7

GetOwningContainerMethod · 0.80
sizeMethod · 0.80
SetHoveringOnSourceMethod · 0.80
NotifyMouseMovedMethod · 0.80
GetMouseXMethod · 0.45
GetMouseYMethod · 0.45
IsMouseDownMethod · 0.45

Tested by

no test coverage detected