projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
started updating for 1.2 release
[rrdtool.git]
/
src
/
rrd_gfx.c
diff --git
a/src/rrd_gfx.c
b/src/rrd_gfx.c
index
2183827
..
5a8c289
100644
(file)
--- a/
src/rrd_gfx.c
+++ b/
src/rrd_gfx.c
@@
-1,5
+1,5
@@
/****************************************************************************
/****************************************************************************
- * RRDtool 1.2rc
2
Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2rc
6
Copyright by Tobi Oetiker, 1997-2005
****************************************************************************
* rrd_gfx.c graphics wrapper for rrdtool
**************************************************************************/
****************************************************************************
* rrd_gfx.c graphics wrapper for rrdtool
**************************************************************************/
@@
-211,10
+211,6
@@
gfx_node_t *gfx_new_text (gfx_canvas_t *canvas,
enum gfx_v_align_en v_align,
char* text){
gfx_node_t *node = gfx_new_node(canvas,GFX_TEXT);
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;
node->text = strdup(text);
node->size = size;
@@
-325,14
+321,6
@@
static void gfx_libart_close_path(gfx_node_t *node, ArtVpath **vec)
art_vpath_add_point (vec, &points, &points_max, ART_END, 0, 0);
}
art_vpath_add_point (vec, &points, &points_max, ART_END, 0, 0);
}
-static void gfx_round_scaled_coordinates(ArtVpath *vec)
-{
- while (vec->code != ART_END) {
- vec->x = floor(vec->x - LINEOFFSET + 0.5) + LINEOFFSET;
- vec->y = floor(vec->y - LINEOFFSET + 0.5) + LINEOFFSET;
- vec++;
- }
-}
/* find bbox of a string */
static void compute_string_bbox(gfx_string string) {
/* find bbox of a string */
static void compute_string_bbox(gfx_string string) {
@@
-384,7
+372,7
@@
gfx_string gfx_string_create(FT_Face face,const char *text,
gfx_char glyph; /* current glyph in table */
unsigned int n;
int error;
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;
ft_pen.x = 0; /* start at (0,0) !! */
ft_pen.y = 0;
@@
-521,22
+509,28
@@
int gfx_render_png (gfx_canvas_t *canvas,
switch (node->type) {
case GFX_LINE:
case GFX_AREA: {
switch (node->type) {
case GFX_LINE:
case GFX_AREA: {
- ArtVpath *vec;
+ ArtVpath *vec
,*pvec
;
double dst[6];
double dst[6];
- ArtSVP *svp;
+ ArtSVP *svp
,*svpt
;
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);
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);
+ /* gfx_round_scaled_coordinates(vec); */
+ pvec = art_vpath_perturb(vec);
+ art_free(vec);
if(node->type == GFX_LINE){
if(node->type == GFX_LINE){
- svp = art_svp_vpath_stroke ( vec, ART_PATH_STROKE_JOIN_ROUND,
+ svp = art_svp_vpath_stroke (
p
vec, ART_PATH_STROKE_JOIN_ROUND,
ART_PATH_STROKE_CAP_ROUND,
ART_PATH_STROKE_CAP_ROUND,
- node->size*canvas->zoom,
1,1
);
+ node->size*canvas->zoom,
4,0.25
);
} else {
} else {
- svp = art_svp_from_vpath ( vec );
+ svp = art_svp_from_vpath ( pvec );
+ svpt = art_svp_uncross( svp );
+ art_free(svp);
+ svp = art_svp_rewind_uncrossed(svpt,ART_WIND_RULE_NONZERO);
+ art_free(svpt);
}
}
- art_free(vec);
+ art_free(
p
vec);
art_rgb_svp_alpha (svp ,0,0, pys_width, pys_height,
node->color, buffer, rowstride, NULL);
art_free(svp);
art_rgb_svp_alpha (svp ,0,0, pys_width, pys_height,
node->color, buffer, rowstride, NULL);
art_free(svp);
@@
-563,8
+557,10
@@
int gfx_render_png (gfx_canvas_t *canvas,
(char *)node->filename,
0,
&face );
(char *)node->filename,
0,
&face );
- if ( error ) break;
-
+ if ( error ) {
+ rrd_set_error("failed to load %s",node->filename);
+ break;
+ }
error = FT_Set_Char_Size(face, /* handle to face object */
(long)(node->size*64),
(long)(node->size*64),
error = FT_Set_Char_Size(face, /* handle to face object */
(long)(node->size*64),
(long)(node->size*64),
@@
-1335,7
+1331,7
@@
static int eps_prologue(eps_state *state)
gfx_node_t *node;
fputs(
"%!PS-Adobe-3.0 EPSF-3.0\n"
gfx_node_t *node;
fputs(
"%!PS-Adobe-3.0 EPSF-3.0\n"
- "%%Creator: RRDtool 1.2rc
2
Tobias Oetiker, http://tobi.oetiker.ch\n"
+ "%%Creator: RRDtool 1.2rc
6
Tobias Oetiker, http://tobi.oetiker.ch\n"
/* can't like weird chars here */
"%%Title: (RRDtool output)\n"
"%%DocumentData: Clean7Bit\n"
/* can't like weird chars here */
"%%Title: (RRDtool output)\n"
"%%DocumentData: Clean7Bit\n"