Skip to content

Commit

Permalink
Merge pull request #1177 from ErwinJanssen/fix/windows-rtest
Browse files Browse the repository at this point in the history
Prevent values like -0 in xdot output
  • Loading branch information
ellson authored Dec 5, 2016
2 parents 03c2f00 + 78f9475 commit b0545a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions plugin/core/gvrender_core_dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ static void xdot_trim_zeros (char* buf, int addSpace)
*/
static void xdot_fmt_num (char* buf, double v)
{
// Prevents values like -0
if (v > -0.00000001 && v < 0.00000001)
{
v = 0;
}
sprintf(buf, "%.02f", v);
xdot_trim_zeros (buf, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/regression_tests/shapes/reference/invhouse.xdot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ graph G {
xdotversion=1.7
];
node [label="\N"];
a [_draw_="c 7 -#000000 p 5 0 12.44 27 -0 54 12.44 53.97 32.56 0.03 32.56 ",
a [_draw_="c 7 -#000000 p 5 0 12.44 27 0 54 12.44 53.97 32.56 0.03 32.56 ",
height=0.5,
label="",
pos="27,18",
Expand Down
2 changes: 1 addition & 1 deletion tests/regression_tests/shapes/reference/invtrapezium.xdot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ graph G {
xdotversion=1.7
];
node [label="\N"];
a [_draw_="c 7 -#000000 p 4 11.23 0 42.77 0 54 36 -0 36 ",
a [_draw_="c 7 -#000000 p 4 11.23 0 42.77 0 54 36 0 36 ",
height=0.5,
label="",
pos="27,18",
Expand Down

0 comments on commit b0545a0

Please sign in to comment.