| 453 | } |
| 454 | |
| 455 | void PatchCable::MouseReleased() |
| 456 | { |
| 457 | if (mDragging) |
| 458 | { |
| 459 | ofVec2f mousePos(TheSynth->GetRawMouseX(), TheSynth->GetRawMouseY()); |
| 460 | if ((mousePos - mGrabPos).distanceSquared() > 3) |
| 461 | { |
| 462 | IClickable* target = GetDropTarget(); |
| 463 | if (target) |
| 464 | mOwner->SetPatchCableTarget(this, target, true); |
| 465 | |
| 466 | Release(); |
| 467 | |
| 468 | if (target == nullptr) |
| 469 | { |
| 470 | if ((CableDropBehavior)UserPrefs.cable_drop_behavior.GetIndex() == CableDropBehavior::ShowQuickspawn) |
| 471 | { |
| 472 | if (GetConnectionType() == kConnectionType_Note || GetConnectionType() == kConnectionType_Audio || GetConnectionType() == kConnectionType_Pulse) |
| 473 | ShowQuickspawnForCable(); |
| 474 | } |
| 475 | |
| 476 | if ((CableDropBehavior)UserPrefs.cable_drop_behavior.GetIndex() == CableDropBehavior::DoNothing) |
| 477 | { |
| 478 | //do nothing |
| 479 | } |
| 480 | |
| 481 | if ((CableDropBehavior)UserPrefs.cable_drop_behavior.GetIndex() == CableDropBehavior::DisconnectCable) |
| 482 | { |
| 483 | mOwner->RemovePatchCable(this, true); |
| 484 | return; |
| 485 | } |
| 486 | |
| 487 | if (mTarget == nullptr) |
| 488 | Destroy(true); |
| 489 | } |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | void PatchCable::ShowQuickspawnForCable() |
| 495 | { |
nothing calls this directly
no test coverage detected