`gvprintdouble` prints to two decimal places. So we can take this into account
when deciding whether we need to print a non-default pen width, squashing:
gvrender_core_svg.c: In function ‘svg_grstyle’:
gvrender_core_svg.c:191:23: warning: comparing floating-point with ‘==’ or
‘!=’ is unsafe [-Wfloat-equal]
191 | if (obj->penwidth != PENWIDTH_NORMAL) {
| ^~
}
gvputs(job, "\" stroke=\"");
svg_print_paint(job, obj->pencolor);
- if (obj->penwidth != PENWIDTH_NORMAL) {
+ // will `gvprintdouble` output something different from `PENWIDTH_NORMAL`?
+ const double GVPRINT_DOUBLE_THRESHOLD = 0.005;
+ if (!(fabs(obj->penwidth - PENWIDTH_NORMAL) < GVPRINT_DOUBLE_THRESHOLD)) {
gvputs(job, "\" stroke-width=\"");
gvprintdouble(job, obj->penwidth);
}