X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_graph.c;h=95ebfe78bf3800c462c37ff58a765244f3bf1d8b;hp=7db75901a3f0040e30cc5791cb9326d18c3157ed;hb=4c3e7607a2cb3c38bf5681996ffd2083a1c8af06;hpb=77befafcc2b7a2aa64b85fe4ff35eb6add64dd7b diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 7db7590..95ebfe7 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1991,39 +1991,32 @@ 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 boxL, boxH, boxV; + int boxH, boxV; - boxL = gfx_get_text_width(im->canvas, 0, + boxH = gfx_get_text_width(im->canvas, 0, im->text_prop[TEXT_PROP_LEGEND].font, im->text_prop[TEXT_PROP_LEGEND].size, - im->tabwidth,"oo", 0); - boxH = boxL / 1.9; - boxV = boxH+1; + im->tabwidth,"o", 0) * 1.2; + boxV = boxH*1.1; - /* make sure transparent colors show up all the same */ + /* make sure transparent colors show up the same way as in the graph */ 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-1,Y0-boxV, - X0-1,Y0, + X0,Y0-boxV, + X0,Y0, X0+boxH,Y0, - im->graph_col[GRC_CANVAS]); + im->graph_col[GRC_BACK]); gfx_add_point ( node, X0+boxH, Y0-boxV ); node = gfx_new_area(im->canvas, - X0-1,Y0-boxV, - X0-1,Y0, + X0,Y0-boxV, + X0,Y0, X0+boxH,Y0, im->gdes[i].col); gfx_add_point ( node, X0+boxH, Y0-boxV ); node = gfx_new_line(im->canvas, - X0-1,Y0-boxV, - X0-1,Y0, - 1,im->graph_col[GRC_FRAME]); + X0,Y0-boxV, + X0,Y0, + 1.0,im->graph_col[GRC_FRAME]); gfx_add_point(node,X0+boxH,Y0); gfx_add_point(node,X0+boxH,Y0-boxV); gfx_close_path(node);