diff options
author | Werner Almesberger <werner@almesberger.net> | 2016-09-29 21:48:00 -0300 |
---|---|---|
committer | Werner Almesberger <werner@almesberger.net> | 2016-09-29 22:00:26 -0300 |
commit | 2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d (patch) | |
tree | 0f0595cbd998d30e0178035f91b30f7ed6757e54 /gui | |
parent | 2c9e549c9554e0cabb4d4ccdb2c3a2238d62bcf4 (diff) | |
download | eeshow-2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d.tar.gz eeshow-2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d.tar.bz2 eeshow-2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d.zip |
get rid of sch_render_extra and move selection to rendering (WIP)
This works for eeshow, but this breaks the -e option of eeplot and eediff,
permanently enabling it in FIG, and permanently disabling it in all the
Cairo-based formats.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/common.h | 1 | ||||
-rw-r--r-- | gui/index.c | 2 | ||||
-rw-r--r-- | gui/render.c | 39 |
3 files changed, 10 insertions, 32 deletions
diff --git a/gui/common.h b/gui/common.h index 9808e31..18f0ab2 100644 --- a/gui/common.h +++ b/gui/common.h @@ -35,7 +35,6 @@ struct gui_sheet { struct gui *gui; /* back link */ struct gui_hist *hist; /* back link */ struct gfx *gfx; - struct gfx *gfx_extra; int w, h; /* in eeschema coordinates */ int xmin, ymin; diff --git a/gui/index.c b/gui/index.c index a72ce21..3ee581e 100644 --- a/gui/index.c +++ b/gui/index.c @@ -279,7 +279,7 @@ static void index_render_sheet(const struct gui *gui, xo = -(xmin + w / 2) * f + thumb_w / 2; yo = -(ymin + h / 2) * f + thumb_h / 2; - cro_img(gfx_user(sheet->gfx_thumb), NULL, + cro_img(gfx_user(sheet->gfx_thumb), 0, xo, yo, thumb_w, thumb_h, f, 0, NULL, &stride); sheet->thumb_surf = cro_img_surface(gfx_user(sheet->gfx_thumb)); diff --git a/gui/render.c b/gui/render.c index 1686042..a6289a4 100644 --- a/gui/render.c +++ b/gui/render.c @@ -159,9 +159,8 @@ static void hack(const struct gui *gui, cairo_t *cr, areas = changed_sheets(gui, xo, yo, f); diff_to_canvas(cr, gui->x, gui->y, gui->scale, - gfx_user(old->gfx), show_extra ? gfx_user(old->gfx_extra) : NULL, - gfx_user(new->gfx), show_extra ? gfx_user(new->gfx_extra) : NULL, - areas); + gfx_user(old->gfx), gfx_user(new->gfx), + show_extra ? gfx_pin_type : 0, areas); free_areas(&areas); } @@ -174,6 +173,7 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr, GtkAllocation alloc; float f = gui->scale; int x, y; + enum gfx_extra extra = show_extra ? gfx_pin_type : 0; gtk_widget_get_allocation(gui->da, &alloc); x = -(sheet->xmin + gui->x) * f + alloc.width / 2; @@ -182,18 +182,12 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr, cro_canvas_prepare(cr); if (!gui->old_hist || gui->diff_mode == diff_new) { highlight_glabel(gui, sheet, cr, x, y, f); - if (show_extra) - cro_canvas_draw(gfx_user(sheet->gfx_extra), - cr, x, y, f); - cro_canvas_draw(gfx_user(sheet->gfx), cr, x, y, f); + cro_canvas_draw(gfx_user(sheet->gfx), cr, x, y, f, extra); } else if (gui->diff_mode == diff_old) { sheet = find_corresponding_sheet(gui->old_hist->sheets, gui->new_hist->sheets, gui->curr_sheet); highlight_glabel(gui, sheet, cr, x, y, f); - if (show_extra) - cro_canvas_draw(gfx_user(sheet->gfx_extra), - cr, x, y, f); - cro_canvas_draw(gfx_user(sheet->gfx), cr, x, y, f); + cro_canvas_draw(gfx_user(sheet->gfx), cr, x, y, f, extra); } else if (use_delta) { struct area *areas = changed_sheets(gui, x, y, f); const struct area *area; @@ -207,17 +201,10 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr, free_areas(&areas); /* @@@ fix geometry later */ - if (show_extra) { - cro_canvas_draw(gfx_user(gui->delta_ab.gfx_extra), - cr, x, y, f); - cro_canvas_draw(gfx_user(gui->delta_a.gfx_extra), - cr, x, y, f); - cro_canvas_draw(gfx_user(gui->delta_b.gfx_extra), - cr, x, y, f); - } - cro_canvas_draw(gfx_user(gui->delta_ab.gfx), cr, x, y, f); - cro_canvas_draw(gfx_user(gui->delta_a.gfx), cr, x, y, f); - cro_canvas_draw(gfx_user(gui->delta_b.gfx), cr, x, y, f); + cro_canvas_draw(gfx_user(gui->delta_ab.gfx), cr, x, y, f, + extra); + cro_canvas_draw(gfx_user(gui->delta_a.gfx), cr, x, y, f, extra); + cro_canvas_draw(gfx_user(gui->delta_b.gfx), cr, x, y, f, extra); } else { hack(gui, cr, x, y, f); } @@ -264,10 +251,6 @@ void render_sheet(struct gui_sheet *sheet) cro_canvas_end(gfx_user(sheet->gfx), &sheet->w, &sheet->h, &sheet->xmin, &sheet->ymin); - sheet->gfx_extra = gfx_init(&cro_canvas_ops); - sch_render_extra(sheet->sch, sheet->gfx_extra); - cro_canvas_end(gfx_user(sheet->gfx_extra), NULL, NULL, NULL, NULL); - sheet->rendered = 1; // gfx_end(); } @@ -302,10 +285,6 @@ void render_delta(struct gui *gui) cro_color_override(gfx_user(gui->delta_a.gfx), COLOR_RED); cro_color_override(gfx_user(gui->delta_b.gfx), COLOR_GREEN2); - cro_color_override(gfx_user(gui->delta_ab.gfx_extra), COLOR_LIGHT_GREY); - cro_color_override(gfx_user(gui->delta_a.gfx_extra), COLOR_RED); - cro_color_override(gfx_user(gui->delta_b.gfx_extra), COLOR_GREEN2); - // @@@ clean up when leaving sheet #endif |