diff --git a/src/main/scala/ocelot/desktop/ui/widget/WorkspaceView.scala b/src/main/scala/ocelot/desktop/ui/widget/WorkspaceView.scala index 34508b7..6ae8ed6 100644 --- a/src/main/scala/ocelot/desktop/ui/widget/WorkspaceView.scala +++ b/src/main/scala/ocelot/desktop/ui/widget/WorkspaceView.scala @@ -493,28 +493,16 @@ class WorkspaceView extends Widget with Persistable with MouseHandler with Hover g.setSmallFont() - val iconBoundsInflate = -(node.bounds.w - 22) / 2 - g.rect(node.bounds.inflate(-10), RGBAColor(0, 0, 0, 150)) - g.sprite(port.getIcon, node.bounds.inflate(iconBoundsInflate), port.getColor) - drawCenteredConnectionHintLabel( - g, - node.bounds, - port.direction.map(node.directionLabel(_)).getOrElse("Any"), - port.getColor - ) - - newConnectionTarget match { - case Some((targetNode, targetPort)) => - g.rect(targetNode.bounds.inflate(-10), RGBAColor(0, 0, 0, 150)) - g.sprite(targetPort.getIcon, targetNode.bounds.inflate(iconBoundsInflate), targetPort.getColor) - drawCenteredConnectionHintLabel( - g, - targetNode.bounds, - targetPort.direction.map(targetNode.directionLabel(_)).getOrElse("Any"), - targetPort.getColor - ) - - case _ => + for ((node, port) <- Some((node, port)) ++ newConnectionTarget) { + val iconBoundsInflate = -(node.bounds.w - 22) / 2 + g.rect(node.bounds.inflate(-10), RGBAColor(0, 0, 0, 150)) + g.sprite(port.getIcon, node.bounds.inflate(iconBoundsInflate), port.getColor) + drawCenteredConnectionHintLabel( + g, + node.bounds, + port.direction.map(node.directionLabel(_)).getOrElse("Any"), + port.getColor + ) } g.setNormalFont()