s->width = w;
if (s->graph == NULL) {
if (s->width > 0 && s->width < MAX_GRAPH_DEPTH) {
- s->graph_width = s->width - 3; // subtract 3 for the box
+ s->graph_width = s->width/* - 2*/; // subtract 2 for the box
} else {
- s->graph_width = MAX_GRAPH_DEPTH - 3;
+ s->graph_width = MAX_GRAPH_DEPTH - 2;
}
s->graph = malloc(s->graph_width * sizeof(double));
memset(s->graph, 0, s->graph_width * sizeof(double));
s->scaled = 1;
}
/*if (s->width) {
- s->graph_width = s->width - 3; // subtract 3 for rectangle around
+ s->graph_width = s->width - 2; // subtract 2 for rectangle around
}*/
if (s->scaled) {
s->graph_scale = 1;
if (specials[special_index].last_colour != specials[special_index].first_colour) {
tmpcolour = specials[special_index].last_colour;
gradient_size = gradient_max(specials[special_index].last_colour, specials[special_index].first_colour);
- gradient_factor = (float)gradient_size / (w);
+ gradient_factor = (float)gradient_size / (w - 2);
}
- for (i = w; i > -1; i--) {
+ for (i = w - 2; i > -1; i--) {
if (specials[special_index].last_colour != specials[special_index].first_colour) {
XSetForeground(display, window.gc, tmpcolour);
gradient_update += gradient_factor;
gradient_update--;
}
}
- if ((w - i) / ((float) (w) / (specials[special_index].graph_width)) > j) {
+ if ((w - i) / ((float) (w - 2) / (specials[special_index].graph_width)) > j && j < MAX_GRAPH_DEPTH - 3) {
j++;
}
- XDrawLine(display, window.drawable, window.gc, cur_x + i - 1, by + h, cur_x + i - 1, by + h - specials[special_index].graph[j] * (h - 1) / specials[special_index].graph_scale); /* this is mugfugly, but it works */
+ XDrawLine(display, window.drawable, window.gc, cur_x + i + 1, by + h, cur_x + i + 1, by + h - specials[special_index].graph[j] * (h - 1) / specials[special_index].graph_scale); /* this is mugfugly, but it works */
}
if (specials[special_index].
height > cur_y_add