From bfd2ef39a2c3917dfac825993b828d3e1750e31f Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 9 Aug 2016 13:12:10 -0300 Subject: [PATCH] eeshow/gui-over.c: style is now copied, not just referenced This way, we can generate styles on the fly and won't have to manage a huge collection of pre-designed styles. --- eeshow/gui-over.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eeshow/gui-over.c b/eeshow/gui-over.c index f54a393..eb2fa94 100644 --- a/eeshow/gui-over.c +++ b/eeshow/gui-over.c @@ -43,7 +43,7 @@ struct overlay { const char *s; - const struct overlay_style *style; + struct overlay_style style; struct aoi **aois; bool (*hover)(void *user, bool on); @@ -162,7 +162,7 @@ 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 struct overlay_style *style = &over->style; const double *fg = style->fg; const double *bg = style->bg; const double *frame = style->frame; @@ -293,7 +293,7 @@ struct overlay *overlay_add(struct overlay **overlays, struct aoi **aois, over = alloc_type(struct overlay); over->s = NULL; - over->style = &overlay_style_default; + over->style = overlay_style_default; over->aois = aois; over->hover = hover; @@ -311,7 +311,7 @@ struct overlay *overlay_add(struct overlay **overlays, struct aoi **aois, void overlay_style(struct overlay *over, const struct overlay_style *style) { - over->style = style; + over->style = *style; }