From b51e380e3684076229725c83d70e93f25bad16c8 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 15 Jan 2018 09:25:41 -0500 Subject: [PATCH] Draw opaque wire if one of its ports is hovered --- src/app/WireWidget.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/WireWidget.cpp b/src/app/WireWidget.cpp index e202d247..6b58c749 100644 --- a/src/app/WireWidget.cpp +++ b/src/app/WireWidget.cpp @@ -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(gHoveredWidget); + if (hoveredPort && (hoveredPort == outputPort || hoveredPort == inputPort)) + opacity = 1.0; + } Vec outputPos = getOutputPos(); Vec inputPos = getInputPos();