From: Emden R. Gansner Date: Mon, 10 Mar 2014 19:28:48 +0000 (-0400) Subject: Remove remnants of dpi use in svg output; all output should be based on X-Git-Tag: 2.38.0~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bb60f116892261cce59d43cbbf4a3499c445adc;p=graphviz Remove remnants of dpi use in svg output; all output should be based on device-independent unit of points. It is the role of the svg viewer to correctly handle point to pixel conversion. --- diff --git a/plugin/core/gvloadimage_core.c b/plugin/core/gvloadimage_core.c index 3904bd751..4e9176457 100644 --- a/plugin/core/gvloadimage_core.c +++ b/plugin/core/gvloadimage_core.c @@ -48,12 +48,10 @@ typedef enum { static void core_loadimage_svg(GVJ_t * job, usershape_t *us, boxf b, boolean filled) { -// FIXME - no idea why this magic 72/96 is needed for images! >>> - double width = (b.UR.x-b.LL.x)*72/96; - double height = (b.UR.y-b.LL.y)*72/96; + double width = (b.UR.x-b.LL.x); + double height = (b.UR.y-b.LL.y); double originx = (b.UR.x+b.LL.x - width)/2; double originy = (b.UR.y+b.LL.y + height)/2; -// <<< assert(job); assert(us); assert(us->name); diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index 59327ca9f..68502c97e 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -175,10 +175,10 @@ static void svg_begin_graph(GVJ_t * job) gvprintf(job, "width, job->height); gvprintf(job, " viewBox=\"%.2f %.2f %.2f %.2f\"", - job->canvasBox.LL.x * (job->dpi.x/POINTS_PER_INCH), - job->canvasBox.LL.y * (job->dpi.y/POINTS_PER_INCH), - job->canvasBox.UR.x * (job->dpi.x/POINTS_PER_INCH), - job->canvasBox.UR.y * (job->dpi.y/POINTS_PER_INCH)); + job->canvasBox.LL.x, + job->canvasBox.LL.y, + job->canvasBox.UR.x, + job->canvasBox.UR.y); /* namespace of svg */ gvputs(job, " xmlns=\"http://www.w3.org/2000/svg\""); /* namespace of xlink */