all good now
authorBrenden Matthews <brenden1@rty.ca>
Sat, 30 Jul 2005 23:05:03 +0000 (23:05 +0000)
committerBrenden Matthews <brenden1@rty.ca>
Sat, 30 Jul 2005 23:05:03 +0000 (23:05 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@34 7f574dfc-610e-0410-a909-a81674777703

conky.c

diff --git a/conky.c b/conky.c
index 4c3bee7..de26c67 100644 (file)
--- a/conky.c
+++ b/conky.c
@@ -315,11 +315,11 @@ inline void graph_append(struct special_t *graph, double f)
        if (graph->scaled) {
                graph->graph_scale = 0;
        }
-       graph->graph[graph->graph_width - 1] = f;
-       for (i = 0; i < graph->graph_width - 1; i++) {
+       graph->graph[graph->graph_width - 1] = f; /* add new data */
+       for (i = 0; i < graph->graph_width - 1; i++) { /* shift all the data by 1 */
                graph->graph[i] = graph->graph[i + 1];
                if (graph->scaled && graph->graph[i] > graph->graph_scale) {
-                       graph->graph_scale = graph->graph[i];
+                       graph->graph_scale = graph->graph[i]; /* check if we need to update the scale */
                }
        }
 }