Fixed Issue 217.

This commit is contained in:
Michael Möller 2011-05-15 16:00:22 +00:00
parent 32112f3e95
commit c7943dc624

View File

@ -176,6 +176,9 @@ namespace OpenHardwareMonitor.GUI {
}
private string GetString() {
if (!sensor.Value.HasValue)
return "-";
switch (sensor.SensorType) {
case SensorType.Voltage:
return string.Format("{0:F11}", sensor.Value);
@ -237,7 +240,8 @@ namespace OpenHardwareMonitor.GUI {
graphics.Clear(Color.Black);
}
graphics.FillRectangle(darkBrush, 0.5f, -0.5f, bitmap.Width - 2, bitmap.Height);
float y = 0.16f * (100 - sensor.Value.Value);
float value = sensor.Value.GetValueOrDefault();
float y = 0.16f * (100 - value);
graphics.FillRectangle(brush, 0.5f, -0.5f + y, bitmap.Width - 2, bitmap.Height - y);
graphics.DrawRectangle(pen, 1, 0, bitmap.Width - 3, bitmap.Height - 1);