diff --git a/eeshow/gfx/cro.c b/eeshow/gfx/cro.c index 317ff10..65e241c 100644 --- a/eeshow/gfx/cro.c +++ b/eeshow/gfx/cro.c @@ -45,7 +45,6 @@ struct cro_ctx { struct record record; /* must be first */ int xo, yo; /* offset in target (e.g., canvas) coord */ - int xe, ye; /* additional offset in eeschema coord */ float scale; cairo_t *cr; @@ -74,13 +73,13 @@ static inline int dc(const struct cro_ctx *cc, int x) static inline int cx(const struct cro_ctx *cc, int x) { - return cc->xo + (x + cc->xe) * cc->scale; + return cc->xo + x * cc->scale; } static inline int cy(const struct cro_ctx *cc, int y) { - return cc->yo + (y + cc->ye) * cc->scale; + return cc->yo + y * cc->scale; } @@ -265,7 +264,6 @@ static struct cro_ctx *new_cc(void) cc = alloc_type(struct cro_ctx); cc->xo = cc->yo = 0; - cc->xe = cc->ye = 0; cc->scale = DEFAULT_SCALE; cc->sheets = NULL; @@ -535,7 +533,6 @@ void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr, int xo, int yo, uint32_t *cro_img(struct cro_ctx *ctx, int xo, int yo, int w, int h, - int xe, int ye, float scale, cairo_t **res_cr, int *res_stride) { int stride; @@ -562,8 +559,6 @@ uint32_t *cro_img(struct cro_ctx *ctx, int xo, int yo, int w, int h, ctx->s = s; ctx->xo = xo; ctx->yo = yo; - ctx->xe = xe; - ctx->ye = ye; ctx->scale = scale; ctx->color_override = COLOR_NONE; diff --git a/eeshow/gfx/cro.h b/eeshow/gfx/cro.h index 954a3d7..3e9d9fd 100644 --- a/eeshow/gfx/cro.h +++ b/eeshow/gfx/cro.h @@ -44,7 +44,6 @@ void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr, int x, int y, float scale); uint32_t *cro_img(struct cro_ctx *ctx, int x0, int yo, int w, int h, - int xe, int ye, float scale, cairo_t **res_cr, int *res_stride); #endif /* !GFX_CRO_H */ diff --git a/eeshow/gfx/diff.c b/eeshow/gfx/diff.c index 05f4f18..14a9f68 100644 --- a/eeshow/gfx/diff.c +++ b/eeshow/gfx/diff.c @@ -350,29 +350,15 @@ void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale, merge_coord(old_xmin, new_xmin, old_w, new_w, &xmin, &w); merge_coord(old_ymin, new_ymin, old_h, new_h, &ymin, &h); - /* - * We use two sets of offset differences: one applied to eeschema - * coordinates (the xe, ye pair), and one applied to canvas coordinates - * (the xo, yo pair). - * - * This is to prevent different offsets from leading to rounding - * differences, resulting in single-pixel differences, which in turn - * the differences algorithm will be eager to mark with big yellow - * boxes. - */ img_old = cro_img(old, sw / 2.0 - (cx + xmin) * scale, sh / 2.0 - (cy + ymin) * scale, sw, sh, - xmin - old_xmin, - ymin - old_ymin, scale, &old_cr, &stride); img_new = cro_img(new, sw / 2.0 - (cx + xmin) * scale, sh / 2.0 - (cy + ymin) * scale, sw, sh, - xmin - new_xmin, - ymin - new_ymin, scale, NULL, NULL); struct diff diff = {