summaryrefslogtreecommitdiff
path: root/gui/render.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-20 09:01:59 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-20 09:01:59 -0300
commit1212a3d89560f34c3a86285cd7ed26033b183138 (patch)
treedd7ca30ae4be16863c24bf352b952a3dd70ef0b1 /gui/render.c
parent2d5d8c3951d99b4ea6ba8806b6ba41c02a114eee (diff)
downloadeeshow-1212a3d89560f34c3a86285cd7ed26033b183138.tar.gz
eeshow-1212a3d89560f34c3a86285cd7ed26033b183138.tar.bz2
eeshow-1212a3d89560f34c3a86285cd7ed26033b183138.zip
eeshow/gui/render.c: resurrect delta mode (A toggles between delta and diff)
Diffstat (limited to 'gui/render.c')
-rw-r--r--gui/render.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gui/render.c b/gui/render.c
index 3bf1db9..23363e0 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -18,11 +18,13 @@
#include <gtk/gtk.h>
#include "misc/util.h"
+#include "gfx/style.h"
#include "gfx/cro.h"
#include "gfx/gfx.h"
#include "kicad/sch.h"
#include "kicad/delta.h"
#include "gfx/diff.h"
+#include "gfx/diff.h"
#include "gui/aoi.h"
#include "gui/over.h"
#include "gui/common.h"
@@ -37,6 +39,9 @@
#define GLABEL_HIGHLIGHT_PAD 6
+bool use_delta = 0;
+
+
/* ----- Helper functions -------------------------------------------------- */
@@ -170,13 +175,12 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
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
+ } else if (use_delta) {
/* @@@ fix geometry later */
cro_canvas_draw(ctx->delta_ab.gfx_ctx, cr, x, y, f);
cro_canvas_draw(ctx->delta_a.gfx_ctx, cr, x, y, f);
cro_canvas_draw(ctx->delta_b.gfx_ctx, cr, x, y, f);
-#endif
+ } else {
hack(ctx, cr, x, y, f);
}
@@ -216,12 +220,12 @@ void render_sheet(struct gui_sheet *sheet)
void render_delta(struct gui_ctx *ctx)
{
-#if 0
+#if 1
/* @@@ needs updating for curr/last vs. new/old */
struct sheet *sch_a, *sch_b, *sch_ab;
- const struct gui_sheet *a = ctx->curr_sheet;
- const struct gui_sheet *b = find_corresponding_sheet(
- ctx->last_hist->sheets, ctx->curr_hist->sheets, ctx->curr_sheet);
+ struct gui_sheet *a = ctx->curr_sheet;
+ struct gui_sheet *b = find_corresponding_sheet(
+ ctx->old_hist->sheets, ctx->new_hist->sheets, ctx->curr_sheet);
sch_a = alloc_type(struct sheet);
sch_b = alloc_type(struct sheet);
@@ -242,8 +246,6 @@ void render_delta(struct gui_ctx *ctx)
// @@@ clean up when leaving sheet
#endif
- struct gui_sheet *b = find_corresponding_sheet(
- ctx->old_hist->sheets, ctx->new_hist->sheets, ctx->curr_sheet);
if (!b->rendered) {
render_sheet(b);