From 733c5a017a22ab4812753c25dfaf9bbffd3b5839 Mon Sep 17 00:00:00 2001 From: KSP-TaxiService Date: Thu, 11 Jan 2018 21:40:23 +0800 Subject: [PATCH] Fix minor logic --- src/CommNetConstellation/CommNetLayer/CNCCommNetUI.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/CommNetConstellation/CommNetLayer/CNCCommNetUI.cs b/src/CommNetConstellation/CommNetLayer/CNCCommNetUI.cs index 9056cda..a4d6cf3 100644 --- a/src/CommNetConstellation/CommNetLayer/CNCCommNetUI.cs +++ b/src/CommNetConstellation/CommNetLayer/CNCCommNetUI.cs @@ -419,13 +419,12 @@ private void updateCustomisedView() for (int i = numLinks-1; i >= 0; i--) { CommLink commLink = net.Links[i]; - float f = (float)net.Links[i].GetBestSignal(); - float t = Mathf.Pow(f, this.colorLerpPower); + float lvl = Mathf.Pow((float)net.Links[i].GetBestSignal(), this.colorLerpPower); Color customHighColor = getConstellationColor(commLink.a, commLink.b); if (this.swapHighLow) - this.line.SetColor(Color.Lerp(customHighColor, this.colorLow, t), i); + this.line.SetColor(Color.Lerp(customHighColor, this.colorLow, lvl), i); else - this.line.SetColor(Color.Lerp(this.colorLow, customHighColor, t), i); + this.line.SetColor(Color.Lerp(this.colorLow, customHighColor, lvl), i); } break; }