| 557 | } |
| 558 | |
| 559 | void IDrawableModule::DrawConnection(IClickable* target) |
| 560 | { |
| 561 | float lineWidth = 1; |
| 562 | float plugWidth = 4; |
| 563 | int lineAlpha = 100; |
| 564 | |
| 565 | IDrawableModule* targetModule = dynamic_cast<IDrawableModule*>(target); |
| 566 | |
| 567 | bool fatCable = false; |
| 568 | if (TheSynth->GetLastClickedModule() == this || |
| 569 | TheSynth->GetLastClickedModule() == targetModule) |
| 570 | fatCable = true; |
| 571 | |
| 572 | if (fatCable) |
| 573 | { |
| 574 | lineWidth = 3; |
| 575 | plugWidth = 8; |
| 576 | lineAlpha = 255; |
| 577 | } |
| 578 | |
| 579 | ofPushMatrix(); |
| 580 | ofPushStyle(); |
| 581 | |
| 582 | PatchCableOld cable = GetPatchCableOld(target); |
| 583 | |
| 584 | ofColor lineColor = GetColor(kModuleCategory_Other); |
| 585 | lineColor.setBrightness(lineColor.getBrightness() * .8f); |
| 586 | ofColor lineColorAlphaed = lineColor; |
| 587 | lineColorAlphaed.a = lineAlpha; |
| 588 | |
| 589 | float wThis, hThis, xThis, yThis; |
| 590 | GetDimensions(wThis, hThis); |
| 591 | GetPosition(xThis, yThis); |
| 592 | |
| 593 | ofSetLineWidth(plugWidth); |
| 594 | ofSetColor(lineColor); |
| 595 | ofLine(cable.plug.x, cable.plug.y, cable.end.x, cable.end.y); |
| 596 | |
| 597 | ofSetLineWidth(lineWidth); |
| 598 | ofSetColor(lineColorAlphaed); |
| 599 | ofLine(cable.start.x, cable.start.y, cable.plug.x, cable.plug.y); |
| 600 | |
| 601 | ofPopStyle(); |
| 602 | ofPopMatrix(); |
| 603 | } |
| 604 | |
| 605 | void IDrawableModule::SetTarget(IClickable* target) |
| 606 | { |
no test coverage detected