Number: 1550
Title: multiple bugs in vml-format output
Submitter: steve roush
Date: Tue Jan 13 15:34:03 2009
Subsys: Output generation
Version: 2.20.3
System: *-*-
Severity: minor
Problem:
There are multiple bugs in VML output:

- text is positioned in "px", not "pt" and is incorrect, at least on my monitor.
- edges are drawn as polygons and are filled!  Thus any curved edge is filled.

Below is a diff containing fixes.
Input:

// dot -Tvml -o demo.html demo.dot

digraph mainmap {
 node [shape=box];

 "top" -> "extra wide middleA";
 "top" -> "extra wide middleB";
 "top" -> "bottom";
 "extra wide middleA" -> "bottom";
 "extra wide middleB" -> "bottom";
}
Comments: The reason I use VML is to add animation javascript via simple postprocessing.
Fix:

diff -r graphviz-2.20.3/plugin/core/gvrender_core_vml.c graphviz-2.20.3.fixed/plugin/core/gvrender_core_vml.c
87,88c87,88
<     gvdevice_fputs(job, "<v:stroke fillcolor="");
<     if (filled)
---
> >     if (filled){
> >       gvdevice_fputs(job, "<v:stroke fillcolor="");
90,91c90,92
<     else
<       gvdevice_fputs(job, "none");
---
> >     }else{
> >       gvdevice_fputs(job, "<v:stroke fill="false");
> >     }
123,125c124,125
<
<     gvdevice_fputs(job, "<v:fill color="");
<     if (filled)
---
> >     if (filled){
> >       gvdevice_fputs(job, "<v:fill color="");
127,128c127,129
<     else
<       gvdevice_fputs(job, "none");
---
> >     }else{
> >       gvdevice_fputs(job, "<v:fill on="false");
> >     }
209a211
> >
213a216
> >         p.x -=para->width;
220a224
> >         p.x -=(para->width/2);
223c227,228
<     gvdevice_printf(job, "position: absolute; left: %gpx; top: %gpx;", p.x/.75, job->height - p.y/.75 - 14);
---
> >
> >     gvdevice_printf(job, "position: absolute; left: %gpt; top: %gpt; width: %gpt;", p.x, (job->height *.75) - p.y - 14, para->width);

Owner: *
Status: *