summaryrefslogtreecommitdiff
path: root/gui-over.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-09 16:01:01 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-09 16:01:01 -0300
commitcf1cbe0ba75b734c24f458ba7b70f59259db3b58 (patch)
tree8674efa93e4f4cdc1fa93283e7024b8bc29180be /gui-over.c
parente5bf56acaac3226b8f3ffae629f472124b6c7899 (diff)
downloadeeshow-cf1cbe0ba75b734c24f458ba7b70f59259db3b58.tar.gz
eeshow-cf1cbe0ba75b734c24f458ba7b70f59259db3b58.tar.bz2
eeshow-cf1cbe0ba75b734c24f458ba7b70f59259db3b58.zip
eeshow/gui-over.h: use struct for color, instead of array
That way, we can use assignments on them.
Diffstat (limited to 'gui-over.c')
-rw-r--r--gui-over.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gui-over.c b/gui-over.c
index 409b42d..cfdd9ef 100644
--- a/gui-over.c
+++ b/gui-over.c
@@ -68,9 +68,9 @@ static void rrect(cairo_t *cr, int x, int y, int w, int h, int r)
struct overlay *overlay_draw(struct overlay *over, cairo_t *cr, int *x, int *y)
{
const struct overlay_style *style = &over->style;
- const double *fg = style->fg;
- const double *bg = style->bg;
- const double *frame = style->frame;
+ const struct color *fg = &style->fg;
+ const struct color *bg = &style->bg;
+ const struct color *frame = &style->frame;
unsigned ink_w, ink_h; /* effectively used text area size */
unsigned w, h; /* box size */
int tx, ty; /* text start position */
@@ -120,9 +120,9 @@ fprintf(stderr, "%d + %d %d + %d\n",
rrect(cr, sx, sy, w, h, style->radius);
- cairo_set_source_rgba(cr, bg[0], bg[1], bg[2], bg[3]);
+ cairo_set_source_rgba(cr, bg->r, bg->g, bg->b, bg->alpha);
cairo_fill_preserve(cr);
- cairo_set_source_rgba(cr, frame[0], frame[1], frame[2], frame[3]);
+ cairo_set_source_rgba(cr, frame->r, frame->g, frame->b, frame->alpha);
cairo_set_line_width(cr, style->width);
cairo_stroke(cr);
@@ -147,7 +147,7 @@ fprintf(stderr, "%u(%d) %u %.60s\n", ty, ink_rect.y / PANGO_SCALE, ink_h, over->
cairo_clip(cr);
}
- cairo_set_source_rgba(cr, fg[0], fg[1], fg[2], fg[3]);
+ cairo_set_source_rgba(cr, fg->r, fg->g, fg->b, fg->alpha);
cairo_move_to(cr, tx, ty);
pango_cairo_update_layout(cr, layout);