summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-29 12:44:44 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-29 12:44:44 -0300
commit8ce33e6a9a3ae71ee5837403193cd12ef47ebe0e (patch)
tree24fd7f56b2906511696eebd95232e179aa2309fc /gfx
parent78862dd12143f561305069deae96e5f6e978ab8c (diff)
downloadeeshow-8ce33e6a9a3ae71ee5837403193cd12ef47ebe0e.tar.gz
eeshow-8ce33e6a9a3ae71ee5837403193cd12ef47ebe0e.tar.bz2
eeshow-8ce33e6a9a3ae71ee5837403193cd12ef47ebe0e.zip
gfx/cro.c (cro_img): gently adjust the line width
This greatly improves the thumbnails in index mode.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 1668ca5..421fd9c 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -816,6 +816,7 @@ uint32_t *cro_img(struct cro_ctx *cc, struct cro_ctx *cc_extra,
uint32_t *data;
cairo_t *cr;
cairo_surface_t *s;
+ int line_width;
stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, w);
data = alloc_size(stride * h);
@@ -827,7 +828,17 @@ uint32_t *cro_img(struct cro_ctx *cc, struct cro_ctx *cc_extra,
cairo_set_source_rgb(cr, 1, 1, 1);
cairo_paint(cr);
- cairo_set_line_width(cr, 2);
+ /*
+ * @@@ hack ! we should use a properly scaled width for each
+ * individual line, with the cavas offset based on the width of
+ * the default line width for non-bus lines.
+ */
+ line_width = 24 * scale;
+ if (line_width < 1)
+ line_width = 1;
+ if (line_width & 1)
+ cairo_translate(cr, 0.5, 0.5);
+ cairo_set_line_width(cr, line_width);
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
cc->cr = cr;