X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_graph_helper.c;h=708c2232569b57850c6c60c1d536315cbcfcb924;hb=04ed1c285ff739ad2cd1384e6cfe24aea82cfa7e;hp=2ea3a2d2b563a4e6470e96d6be459d8ad68cb71e;hpb=58a8f90229ee1625e0270256683b048da1b1df24;p=rrdtool.git diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index 2ea3a2d..708c223 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -266,7 +266,7 @@ int rrd_parse_color( default: return 1; /* wrong number of digits */ } - gdp->col = r << 24 | g << 16 | b << 8 | a; + gdp->col = gfx_hex_to_col(r << 24 | g << 16 | b << 8 | a); return 0; } @@ -497,23 +497,22 @@ int rrd_parse_PVHLAST( static int spacecnt = 0; if (spacecnt == 0) { - float one_space = gfx_get_text_width(im->canvas, 0, + float one_space = gfx_get_text_width(im, 0, im-> text_prop[TEXT_PROP_LEGEND]. font, im-> text_prop[TEXT_PROP_LEGEND]. size, - im->tabwidth, " ", - 0) / 4.0; - float target_space = gfx_get_text_width(im->canvas, 0, + im->tabwidth, " ") / 4.0; + float target_space = gfx_get_text_width(im, 0, im-> text_prop [TEXT_PROP_LEGEND].font, im-> text_prop [TEXT_PROP_LEGEND].size, - im->tabwidth, "oo", 0); + im->tabwidth, "oo"); spacecnt = target_space / one_space; dprintf("- spacecnt: %i onespace: %f targspace: %f\n", spacecnt, @@ -607,7 +606,8 @@ int rrd_parse_PVHLAST( rrd_set_error("Could not parse color in '%s'", &tmpstr[j]); return 1; } - dprintf("- parsed color 0x%08x\n", (unsigned int) gdp->col); + dprintf("- parsed color %0.0f,%0.0f,%0.0f,%0.0f\n", gdp->col.red, + gdp->col.green, gdp->col.blue, gdp->col.alpha); colorfound = 1; } else { dprintf("- no color present in '%s'\n", tmpstr);