Hello, have you ever realised that the multiload-applets graphs are off by 3 pixels in the time-axis? This bug existed in gnome 1.4 and still is in gnome 2. This is because a) the frame around the graphs is 2 pixels wide -- on both sides. so we have to subtract 4 instead of 2. b) there is a simple "off-by-one" error in the drawing loop. patch against gnome-applets-2.0.3 is attached. Any chance to get it into gnome? MfG bmg -- "Des is völlig wurscht, was heut beschlos- | M G Berberich sen wird: I bin sowieso dagegn!" | berberic fmi uni-passau de (SPD-Stadtrat Kurt Schindler; Regensburg) |
diff -Naur gnome-applets-2.0.3-orig/multiload/load-graph.c gnome-applets-2.0.3-bmg/multiload/load-graph.c
--- gnome-applets-2.0.3-orig/multiload/load-graph.c Fri Sep 13 21:59:22 2002
+++ gnome-applets-2.0.3-bmg/multiload/load-graph.c Wed Oct 2 19:04:40 2002
@@ -65,8 +65,8 @@
for (i = 0; i < g->draw_width; i++) {
gdk_draw_line (g->pixmap, g->gc,
- g->draw_width - i, g->pos[i],
- g->draw_width - i, g->pos[i] - g->data[i][j]);
+ g->draw_width - i - 1, g->pos[i],
+ g->draw_width - i - 1, g->pos[i] - g->data[i][j]);
g->pos [i] -= g->data [i][j];
}
@@ -172,12 +172,12 @@
load_graph_unalloc (c);
if (c->orient) {
- c->draw_width = c->pixel_size - 2;
- c->draw_height = c->size - 2;
+ c->draw_width = c->pixel_size - 4;
+ c->draw_height = c->size - 4;
}
else {
- c->draw_width = c->size - 2;
- c->draw_height = c->pixel_size - 2;
+ c->draw_width = c->size - 4;
+ c->draw_height = c->pixel_size - 4;
}
load_graph_alloc (c);
@@ -301,12 +301,12 @@
}
if (g->orient) {
- g->draw_width = g->pixel_size - 2;
- g->draw_height = g->size - 2;
+ g->draw_width = g->pixel_size - 4;
+ g->draw_height = g->size - 4;
}
else {
- g->draw_width = g->size - 2;
- g->draw_height = g->pixel_size - 2;
+ g->draw_width = g->size - 4;
+ g->draw_height = g->pixel_size - 4;
}
load_graph_alloc (g);
Attachment:
pgpaI4PvqXGXm.pgp
Description: PGP signature