summaryrefslogtreecommitdiff
path: root/gui/render.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-19 07:05:50 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-19 07:08:22 -0300
commit9f2062ad1ae59ccaf97d471b86f5760943f5a124 (patch)
tree26977a897b88ba08794ab3e940bebc06955d44a3 /gui/render.c
parent704f5aaa401c4fe2a637d6fe45c5b1f8818b2294 (diff)
downloadeeshow-9f2062ad1ae59ccaf97d471b86f5760943f5a124.tar.gz
eeshow-9f2062ad1ae59ccaf97d471b86f5760943f5a124.tar.bz2
eeshow-9f2062ad1ae59ccaf97d471b86f5760943f5a124.zip
eeshow/gui/: difference display can now be switched with New/Old/Diff
Still need a GUI way to do the same.
Diffstat (limited to 'gui/render.c')
-rw-r--r--gui/render.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gui/render.c b/gui/render.c
index 92b6cc0..5d217e2 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -72,15 +72,15 @@ static inline int cy(int y, int yo, float scale)
}
-static void highlight_glabel(const struct gui_ctx *ctx, cairo_t *cr,
- int x, int y, float f)
+static void highlight_glabel(const struct gui_ctx *ctx,
+ const struct gui_sheet *sheet, cairo_t *cr, int x, int y, float f)
{
const struct sch_obj *obj;
if (!ctx->glabel)
return;
- for (obj = ctx->curr_sheet->sch->objs; obj; obj = obj->next) {
+ for (obj = sheet->sch->objs; obj; obj = obj->next) {
const struct dwg_bbox *bbox = &obj->u.text.bbox;
if (obj->type != sch_obj_glabel)
@@ -127,8 +127,13 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
y = -(sheet->ymin + ctx->y) * f + alloc.height / 2;
cro_canvas_prepare(cr);
- if (!ctx->old_hist) {
- highlight_glabel(ctx, cr, x, y, f);
+ if (!ctx->old_hist || ctx->diff_mode == diff_new) {
+ highlight_glabel(ctx, sheet, cr, x, y, f);
+ cro_canvas_draw(sheet->gfx_ctx, cr, x, y, f);
+ } else if (ctx->diff_mode == diff_old) {
+ sheet = find_corresponding_sheet(ctx->old_hist->sheets,
+ ctx->new_hist->sheets, ctx->curr_sheet);
+ highlight_glabel(ctx, sheet, cr, x, y, f);
cro_canvas_draw(sheet->gfx_ctx, cr, x, y, f);
} else {
#if 0