1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 20:44:56 +00:00

Fix graph auto-scaling when the width is 0

This commit is contained in:
Kevin Lyles 2012-08-15 21:52:20 -05:00 committed by Pavel Labath
parent 6f62e113f1
commit 09467931d4

View File

@ -401,7 +401,7 @@ static void graph_append(struct special_t *graph, double f, char showaslog)
graph->graph[0] = f; /* add new data */
if(graph->scaled) {
graph->scale = *std::max_element(graph->graph + 0, graph->graph + graph->width);
graph->scale = *std::max_element(graph->graph + 0, graph->graph + graph->graph_width);
if(graph->scale < 1e-47) {
/* avoid NaN's when the graph is all-zero (e.g. before the first update)
* there is nothing magical about 1e-47 here */