| 459 | } |
| 460 | |
| 461 | bool 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 | |
| 494 | void PatchCableSource::MouseReleased() |
| 495 | { |
nothing calls this directly
no test coverage detected