summaryrefslogtreecommitdiff
path: root/gui/over.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-18 17:39:08 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-18 17:39:08 -0300
commite0b9410394eed8e7a1534a8994e7ab4019e108e8 (patch)
tree33a6afe639fa2ba88fbe9d68524e4070f3f12733 /gui/over.c
parentc5951ab7bdd8dd303d4efdf9a1fcc6e14c03ccf7 (diff)
downloadeeshow-e0b9410394eed8e7a1534a8994e7ab4019e108e8.tar.gz
eeshow-e0b9410394eed8e7a1534a8994e7ab4019e108e8.tar.bz2
eeshow-e0b9410394eed8e7a1534a8994e7ab4019e108e8.zip
eeshow/gui/over.c (overlay_draw): shift border outside the content area
This also ensures that lines with an odd-numbered width are not blended.
Diffstat (limited to 'gui/over.c')
-rw-r--r--gui/over.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gui/over.c b/gui/over.c
index 32a58b5..bdd33fc 100644
--- a/gui/over.c
+++ b/gui/over.c
@@ -55,7 +55,7 @@ struct overlay {
/* ----- Drawing core ------------------------------------------------------ */
-static void rrect(cairo_t *cr, int x, int y, int w, int h, int r)
+static void rrect(cairo_t *cr, double x, double y, double w, double h, int r)
{
const double deg = M_PI / 180.0;
@@ -78,6 +78,7 @@ static unsigned overlay_draw(struct overlay *over, cairo_t *cr,
unsigned ink_w, ink_h; /* effectively used text area size */
unsigned w, h; /* box size */
int tx, ty; /* text start position */
+ double center;
PangoLayout *layout;
PangoFontDescription *desc;
@@ -114,7 +115,9 @@ fprintf(stderr, "%d + %d %d + %d\n",
tx = x - ink_rect.x / PANGO_SCALE + style->pad;
ty = y - ink_rect.y / PANGO_SCALE + style->pad;
- rrect(cr, x, y, w, h, style->radius);
+ center = style->width / 2.0;
+ rrect(cr, x - center, y - center, w + style->width, h + style->width,
+ style->radius);
cairo_set_source_rgba(cr, bg->r, bg->g, bg->b, bg->alpha);
cairo_fill_preserve(cr);