mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-02 07:15:31 +00:00
Corrected the source formatting.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user