You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #include "Rack.hpp"
-
-
- namespace rack {
-
- void InputPort::draw(NVGcontext *vg) {
- SpriteWidget::draw(vg);
- if (gRackWidget->activeWire && gRackWidget->activeWire->inputPort) {
- Port::drawGlow(vg);
- }
- }
-
- void InputPort::onDragStart() {
- if (connectedWire) {
- // Disconnect wire from this port, but set it as the active wire
- connectedWire->inputPort = NULL;
- connectedWire->updateWire();
- gRackWidget->activeWire = connectedWire;
- connectedWire = NULL;
- }
- else {
- connectedWire = new WireWidget();
- connectedWire->inputPort = this;
- gRackWidget->wireContainer->addChild(connectedWire);
- gRackWidget->activeWire = connectedWire;
- }
- }
-
- void InputPort::onDragDrop(Widget *origin) {
- if (connectedWire) return;
- if (gRackWidget->activeWire) {
- if (gRackWidget->activeWire->inputPort) return;
- gRackWidget->activeWire->inputPort = this;
- connectedWire = gRackWidget->activeWire;
- }
- }
-
-
- } // namespace rack
|