From 8c7eaa52f819a52479f975fbaf58a085b0d30a6c Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Sat, 10 Aug 2024 11:45:54 -0400 Subject: [PATCH] Rendering of stereo connectors in dark mode. --- react/src/PedalboardView.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/react/src/PedalboardView.tsx b/react/src/PedalboardView.tsx index c5014bc..33971b4 100644 --- a/react/src/PedalboardView.tsx +++ b/react/src/PedalboardView.tsx @@ -367,12 +367,14 @@ const PedalboardView = frameRef: React.RefObject; scrollRef: React.RefObject; - + private bgColor: string; constructor(props: PedalboardProps) { super(props); this.model = PiPedalModelFactory.getInstance(); + this.bgColor = props.theme.palette.background.default + if (!props.selectedId) props.selectedId = -1; this.state = { pedalboard: this.model.pedalboard.get(), @@ -692,6 +694,7 @@ const PedalboardView = let y_ = item.bounds.y + CELL_HEIGHT / 2; let numberOfOutputs = item.numberOfOutputs; let color = enabled ? ENABLED_CONNECTOR_COLOR : DISABLED_CONNECTOR_COLOR; + let stereoCenterColor = this.bgColor; let svgPath = new SvgPathBuilder().moveTo(x_, y_).lineTo(x_ + CELL_WIDTH, y_).toString(); if (numberOfOutputs === 2) { @@ -699,7 +702,7 @@ const PedalboardView = )); output.push(( - + )); } else if (numberOfOutputs === 1) { output.push(( @@ -727,14 +730,14 @@ const PedalboardView = if (item.numberOfInputs === 2 && item.topChildren[0].numberOfInputs === 2) { output.push(()); - output.push(()); + output.push(()); } else if (item.numberOfInputs !== 0 && item.topChildren[0].numberOfInputs !== 0) { output.push(()); } if (item.numberOfInputs === 2 && item.bottomChildren[0].numberOfInputs === 2) { output.push(()); - output.push(()); + output.push(()); } else if (item.numberOfInputs !== 0 && item.bottomChildren[0].numberOfInputs !== 0) { output.push(()); @@ -824,7 +827,7 @@ const PedalboardView = )); output.push(( - + )); } else if (!firstPathAbsent) { output.push(( @@ -836,7 +839,7 @@ const PedalboardView = )); output.push(( - + )); } else if (!secondPathAbsent) { output.push(( @@ -868,12 +871,12 @@ const PedalboardView = // draw stereo inner lines. if (firstPathStereo) { output.push(( - + )); } if (secondPathStereo) { output.push(( - + )); } @@ -885,7 +888,7 @@ const PedalboardView = )); output.push(( - + )); @@ -958,7 +961,7 @@ const PedalboardView = let outputs: ReactNode[] = []; this.renderConnectors(outputs, layoutChain, true, false); return ( -
+