From: ellson Date: Thu, 27 Jan 2005 18:46:54 +0000 (+0000) Subject: rearrange previous fix to give scale to old psgen.c X-Git-Tag: LAST_LIBGRAPH~32^2~7987 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5592b60fa2af703417d50ca3c13e50933bcc286c;p=graphviz rearrange previous fix to give scale to old psgen.c --- diff --git a/lib/common/gdgen.c b/lib/common/gdgen.c index c0c5e2aa5..44ca50d6e 100644 --- a/lib/common/gdgen.c +++ b/lib/common/gdgen.c @@ -62,7 +62,6 @@ static gdImagePtr im; /* static int N_pages; */ /* static point Pages; */ -static double Scale; static double Dpi; static double DevScale; static double CompScale; @@ -157,6 +156,7 @@ static void init1_gd(GVC_t * gvc, graph_t * g, box bb, point pb) GraphFocus.y = (GD_bb(g).UR.y - GD_bb(g).LL.y) / 2.; Zoom = 1.0; } + CompScale = Zoom * DevScale; } static void init2_gd(gdImagePtr im) @@ -384,8 +384,6 @@ gd_begin_page(graph_t * g, point page, double scale, int rot, point offset) /* int page_number; */ /* point sz; */ - Scale = scale; - CompScale = Zoom * Scale * DevScale; Rot = rot; /* page_number = page.x + page.y * Pages.x + 1; */ @@ -572,7 +570,7 @@ static void gd_textline(point p, textline_t * line) return; strex.flags = gdFTEX_RESOLUTION; - strex.hdpi = strex.vdpi = Dpi * Zoom * Scale; + strex.hdpi = strex.vdpi = Dpi * Zoom; if (cstk[SP].pen == P_NONE) return; @@ -604,9 +602,9 @@ static void gd_textline(point p, textline_t * line) ep.x = mp.x + line->width; mp = gdpt(mp); - if (fontsz * Zoom * Scale <= FONTSIZE_MUCH_TOO_SMALL) { + if (fontsz * Zoom <= FONTSIZE_MUCH_TOO_SMALL) { /* ignore entirely */ - } else if (fontsz * Zoom * Scale <= FONTSIZE_TOO_SMALL) { + } else if (fontsz * Zoom <= FONTSIZE_TOO_SMALL) { /* draw line in place of text */ ep = gdpt(ep); gdImageLine(im, ROUND(mp.x), ROUND(mp.y), diff --git a/lib/common/mapgen.c b/lib/common/mapgen.c index 7ad2fc2be..d6e39ec02 100644 --- a/lib/common/mapgen.c +++ b/lib/common/mapgen.c @@ -52,7 +52,6 @@ static context_t cstk[MAXNEST]; static int SP; #endif -static double Scale; static double Dpi; static double DevScale; static double CompScale; @@ -314,6 +313,7 @@ static void map_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb) GraphFocus.y = (GD_bb(g).UR.y - GD_bb(g).LL.y) / 2.; Zoom = 1.0; } + CompScale = Zoom * DevScale; if (onetime) { init_imap(); @@ -330,8 +330,6 @@ map_begin_page(graph_t * g, point page, double scale, int rot, { char *url; - Scale = scale; - CompScale = Zoom * Scale * DevScale; Rot = rot; if (Output_lang == CMAPX) { diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 5fe4482ce..53022b9f5 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -315,9 +315,7 @@ void gvrender_begin_page(GVC_t * gvc, double scale, int rot, point offset) gvrender_job_t *job = gvc->job; gvrender_engine_t *gvre = job->render_engine; -// gvc->scale = scale; job->rot = rot; -// gvc->offset = offset; if (gvre && gvre->begin_page) gvre->begin_page(job, gvc->g->name, job->pagesArrayElem, job->pageNum, job->numPages); @@ -327,7 +325,7 @@ void gvrender_begin_page(GVC_t * gvc, double scale, int rot, point offset) codegen_t *cg = job->codegen; if (cg && cg->begin_page) - cg->begin_page(gvc->g, job->pagesArrayElem, 1.0, rot, offset); + cg->begin_page(gvc->g, job->pagesArrayElem, job->zoom, rot, offset); } #endif }