]> granicus.if.org Git - graphviz/commitdiff
Remove remnants of dpi use in svg output; all output should be based on
authorEmden R. Gansner <erg@alum.mit.edu>
Mon, 10 Mar 2014 19:28:48 +0000 (15:28 -0400)
committerEmden R. Gansner <erg@alum.mit.edu>
Mon, 10 Mar 2014 19:28:48 +0000 (15:28 -0400)
device-independent unit of points. It is the role of the svg viewer to
correctly handle point to pixel conversion.

plugin/core/gvloadimage_core.c
plugin/core/gvrender_core_svg.c

index 3904bd751cd16c3f7706cf4cbe8b1d3416f03cfe..4e91764578a6f043422bb01cfb3e9ec0701e0a42 100644 (file)
@@ -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);
index 59327ca9fb2b0f8a33e0edffbc50cb75b82ecece..68502c97e89f73c9f711897a2823ad2906604e80 100644 (file)
@@ -175,10 +175,10 @@ static void svg_begin_graph(GVJ_t * job)
     gvprintf(job, "<svg width=\"%dpt\" height=\"%dpt\"\n",
             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 */