summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c319a9)
raw | patch | inline | side by side (parent: 1c319a9)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 5 Apr 2005 20:17:45 +0000 (20:17 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 5 Apr 2005 20:17:45 +0000 (20:17 +0000) |
* fix x-axis label drawing by considering label precision
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@359 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@359 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_gfx.c | patch | blob | history | |
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c
index 21838275fdb8021151cf4bf39d0b027cf280b399..0a443443cf831b5fba8bfc8298750fbf7561bb56 100644 (file)
--- a/src/rrd_gfx.c
+++ b/src/rrd_gfx.c
enum gfx_v_align_en v_align,
char* text){
gfx_node_t *node = gfx_new_node(canvas,GFX_TEXT);
-/* if (angle != 0.0){*/
- /* currently we only support 0 and 270 */
-/* angle = 270.0;
- }*/
node->text = strdup(text);
node->size = size;
gfx_char glyph; /* current glyph in table */
unsigned int n;
int error;
- int gottab;
+ int gottab = 0;
ft_pen.x = 0; /* start at (0,0) !! */
ft_pen.y = 0;
switch (node->type) {
case GFX_LINE:
case GFX_AREA: {
- ArtVpath *vec;
+ ArtVpath *vec,*pvec;
double dst[6];
- ArtSVP *svp;
+ ArtSVP *svp,*usvp,*rsvp;
art_affine_scale(dst,canvas->zoom,canvas->zoom);
vec = art_vpath_affine_transform(node->path,dst);
if (node->closed_path)
gfx_libart_close_path(node, &vec);
gfx_round_scaled_coordinates(vec);
+ pvec = art_vpath_perturb(vec);
+ art_free(vec);
if(node->type == GFX_LINE){
- svp = art_svp_vpath_stroke ( vec, ART_PATH_STROKE_JOIN_ROUND,
+ svp = art_svp_vpath_stroke ( pvec, ART_PATH_STROKE_JOIN_ROUND,
ART_PATH_STROKE_CAP_ROUND,
node->size*canvas->zoom,1,1);
} else {
- svp = art_svp_from_vpath ( vec );
+ svp = art_svp_from_vpath ( pvec );
}
- art_free(vec);
- art_rgb_svp_alpha (svp ,0,0, pys_width, pys_height,
- node->color, buffer, rowstride, NULL);
+ art_free(pvec);
+ usvp=art_svp_uncross(svp);
art_free(svp);
+ rsvp=art_svp_rewind_uncrossed(usvp,ART_WIND_RULE_ODDEVEN);
+ art_free(usvp);
+ art_rgb_svp_alpha (rsvp ,0,0, pys_width, pys_height,
+ node->color, buffer, rowstride, NULL);
+ art_free(rsvp);
break;
}
case GFX_TEXT: {
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 22f3f542ecd0a6f7a8239775618257b7e0ded974..0279d49d524cbee22831a1546e6528b5195e8fea 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
}
/* paint the labels below the graph */
- for(ti = find_first_time(im->start,
+ for(ti = find_first_time(im->start - im->xlab_user.precis/2,
im->xlab_user.labtm,
im->xlab_user.labst);
- ti <= im->end;
+ ti <= im->end - im->xlab_user.precis/2;
ti = find_next_time(ti,im->xlab_user.labtm,im->xlab_user.labst)
){
tilab= ti + im->xlab_user.precis/2; /* correct time for the label */
/* are we inside the graph ? */
- if (ti < im->start || ti > im->end) continue;
+ if (tilab < im->start || tilab > im->end) continue;
#if HAVE_STRFTIME
localtime_r(&tilab, &tm);
im->tabwidth,"M", 0)*1.2;
boxV = boxH;
+ /* make sure transparent colors show up all the same */
+ node = gfx_new_area(im->canvas,
+ X0,Y0-boxV,
+ X0,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,
gfx_add_point ( node, X0+boxH, Y0-boxV );
node = gfx_new_line(im->canvas,
X0,Y0-boxV, X0,Y0,
- 1,0x000000FF);
+ 1,im->graph_col[GRC_FONT]);
gfx_add_point(node,X0+boxH,Y0);
gfx_add_point(node,X0+boxH,Y0-boxV);
gfx_close_path(node);