[poppler] poppler/poppler: CairoOutputDev.cc,1.46,1.47
Jeff Muizelaar
jrmuizel at kemper.freedesktop.org
Wed Dec 20 11:55:57 PST 2006
Update of /cvs/poppler/poppler/poppler
In directory kemper:/tmp/cvs-serv4741/poppler
Modified Files:
CairoOutputDev.cc
Log Message:
2006-12-20 Jeff Muizelaar <jeff at infidigm.net>
* poppler/GlobalParams.cc: Try to make zero-width lines as close to
one pixel wide as we can. Fixes #9393.
Index: CairoOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.cc,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- CairoOutputDev.cc 12 Dec 2006 05:24:00 -0000 1.46
+++ CairoOutputDev.cc 20 Dec 2006 19:55:55 -0000 1.47
@@ -202,12 +202,18 @@
cairo_set_miter_limit (cairo, state->getMiterLimit());
}
+#define MIN(a,b) (a) < (b) ? (a) : (b)
+
void CairoOutputDev::updateLineWidth(GfxState *state) {
LOG(printf ("line width: %f\n", state->getLineWidth()));
if (state->getLineWidth() == 0.0) {
- cairo_set_line_width (cairo, 72.0/300.0);
+ /* find out how big pixels (device unit) are in the x and y directions
+ * choose the smaller of the two as our line width */
+ double x = 1.0, y = 1.0;
+ cairo_device_to_user_distance(cairo, &x, &y);
+ cairo_set_line_width (cairo, MIN(fabs(x),fabs(y)));
} else {
- cairo_set_line_width (cairo, state->getLineWidth());
+ cairo_set_line_width (cairo, state->getLineWidth());
}
}
More information about the poppler
mailing list