Corrected the source formatting.

This commit is contained in:
Michael Möller
2015-12-18 22:49:53 +01:00
parent 6cbfdce0bc
commit 0e5e4afe5e

View File

@@ -502,24 +502,25 @@ namespace OpenHardwareMonitor.GUI {
}
}
//if a sensor is assigned a color that's already being used by another sensor,
//try to assign it a new color. This is done only after the previous loop
//sets an unchanging default color for all sensors, so that colors jump
//around as little as possible as sensors get added/removed from the plot
List<Color> usedColors = new List<Color>();
// if a sensor is assigned a color that's already being used by another
// sensor, try to assign it a new color. This is done only after the
// previous loop sets an unchanging default color for all sensors, so that
// colors jump around as little as possible as sensors get added/removed
// from the plot
var usedColors = new List<Color>();
foreach (var curSelectedSensor in selected) {
var curColor = colors[curSelectedSensor];
if (usedColors.Contains(curColor)) {
foreach (Color potentialNewColor in plotColorPalette) {
if (!colors.Values.Contains(potentialNewColor)) {
colors[curSelectedSensor] = potentialNewColor;
usedColors.Add(potentialNewColor);
break;
}
}
} else {
usedColors.Add(curColor);
var curColor = colors[curSelectedSensor];
if (usedColors.Contains(curColor)) {
foreach (var potentialNewColor in plotColorPalette) {
if (!colors.Values.Contains(potentialNewColor)) {
colors[curSelectedSensor] = potentialNewColor;
usedColors.Add(potentialNewColor);
break;
}
}
} else {
usedColors.Add(curColor);
}
}
sensorPlotColors = colors;