Code

fix rendering of the color spots especially when proportional fonts are in use.
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 9 May 2005 19:11:05 +0000 (19:11 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 9 May 2005 19:11:05 +0000 (19:11 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@528 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c
src/rrd_graph_helper.c

index b7acddc1b0110ba80c38d39653dc404cfad27c45..2fae2583de02cfda0e96f5edeafac79a4dbfc292 100644 (file)
@@ -1961,7 +1961,7 @@ grid_paint(image_desc_t   *im)
     /* rrdtool 'logo' */
     gfx_new_text( im->canvas,
                  im->ximg-7, 7,
-                 ( im->graph_col[GRC_FONT] & 0xffffff00 ) | 0x00000066,
+                 ( im->graph_col[GRC_FONT] & 0xffffff00 ) | 0x00000044,
                  im->text_prop[TEXT_PROP_AXIS].font,
                  5.5, im->tabwidth, 270,
                  GFX_H_RIGHT, GFX_V_TOP,
@@ -1987,30 +1987,38 @@ grid_paint(image_desc_t   *im)
                     if (          im->gdes[i].gf != GF_PRINT &&
                                   im->gdes[i].gf != GF_GPRINT &&
                                    im->gdes[i].gf != GF_COMMENT) {
-                            int boxH, boxV;
+                            int boxL, boxH, boxV;
                             
-                            boxH = gfx_get_text_width(im->canvas, 0,
+                            boxL = gfx_get_text_width(im->canvas, 0,
                                                       im->text_prop[TEXT_PROP_LEGEND].font,
                                                       im->text_prop[TEXT_PROP_LEGEND].size,
-                                                      im->tabwidth,"M", 0)*1.2;
-                            boxV = boxH;
+                                                      im->tabwidth,"oo", 0);
+                           boxH = boxL / 1.9;
+                            boxV = boxH+1;
                             
                             /* make sure transparent colors show up all the same */
+                            node = gfx_new_area(im->canvas,
+                                                X0-1,Y0-boxV,
+                                                X0-1,Y0+1,
+                                                X0+boxL+0.5,Y0+1,
+                                                im->graph_col[GRC_BACK]);
+                            gfx_add_point ( node, X0+boxL+0.5, Y0-boxV );
                            node = gfx_new_area(im->canvas,
-                                                X0,Y0-boxV,
-                                                X0,Y0,
+                                                X0-1,Y0-boxV,
+                                                X0-1,Y0,
                                                 X0+boxH,Y0,
                                                 im->graph_col[GRC_CANVAS]);
                             gfx_add_point ( node, X0+boxH, Y0-boxV );
 
                             node = gfx_new_area(im->canvas,
-                                                X0,Y0-boxV,
-                                                X0,Y0,
+                                                X0-1,Y0-boxV,
+                                                X0-1,Y0,
                                                 X0+boxH,Y0,
                                                 im->gdes[i].col);
                             gfx_add_point ( node, X0+boxH, Y0-boxV );
                             node = gfx_new_line(im->canvas,
-                                                X0,Y0-boxV, X0,Y0,
+                                                X0-1,Y0-boxV,
+                                                X0-1,Y0,
                                                 1,im->graph_col[GRC_FONT]);
                             gfx_add_point(node,X0+boxH,Y0);
                             gfx_add_point(node,X0+boxH,Y0-boxV);
index 375521c25137250b8a0d1fd1d1960c331291e55a..e857df85be69e08f4294437a6d33554b45ccdfbc 100644 (file)
@@ -402,9 +402,9 @@ rrd_parse_PVHLAST(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc
            /* If the legend is not empty, it has to be prefixed with "m ". This then gets
             * replaced by the color box later on. */
             (*eaten)--;
-            linecp[*eaten]=' ';
+            linecp[*eaten]='o';
             (*eaten)--;
-            linecp[*eaten]='m';
+            linecp[*eaten]='o';
        }
 
        if (rrd_parse_legend(linecp, eaten, gdp)) err=1;