Browse Source

Draw opaque wire if one of its ports is hovered

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
b51e380e36
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      src/app/WireWidget.cpp

+ 11
- 3
src/app/WireWidget.cpp View File

@@ -158,9 +158,17 @@ void WireWidget::draw(NVGcontext *vg) {
float opacity = gToolbar->wireOpacitySlider->value / 100.0;
float tension = gToolbar->wireTensionSlider->value;

// Draw as opaque if an "incomplete" wire
if (!(inputPort && outputPort))
opacity = 1.0;
WireWidget *activeWire = gRackWidget->wireContainer->activeWire;
if (activeWire) {
// Draw as opaque if the wire is active
if (activeWire == this)
opacity = 1.0;
}
else {
Port *hoveredPort = dynamic_cast<Port*>(gHoveredWidget);
if (hoveredPort && (hoveredPort == outputPort || hoveredPort == inputPort))
opacity = 1.0;
}

Vec outputPos = getOutputPos();
Vec inputPos = getInputPos();


Loading…
Cancel
Save