summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-09 12:08:08 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-09 12:08:08 -0300
commitb0df85e3dce9ef0041f2794fc49cb681d625ac4f (patch)
treef405a901820335fd38ec04a3ff45db5f75203622 /diff.c
parentf2416e08969110dcd69328b94612fab18656f2c1 (diff)
downloadeeshow-b0df85e3dce9ef0041f2794fc49cb681d625ac4f.tar.gz
eeshow-b0df85e3dce9ef0041f2794fc49cb681d625ac4f.tar.bz2
eeshow-b0df85e3dce9ef0041f2794fc49cb681d625ac4f.zip
eeshow/diff.c (diff_to_canvas): simplify offset calculation
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index dcd6187..7770b36 100644
--- a/diff.c
+++ b/diff.c
@@ -343,12 +343,12 @@ void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
* be eager to mark with big yellow boxes.
*/
img_old = cro_img(old,
- -scale * cx + sw / 2.0 - (2 * xmin - old_xmin) * scale,
- -scale * cy + sh / 2.0 - (2 * ymin - old_ymin) * scale,
+ sw / 2.0 - (cx + 2 * xmin - old_xmin) * scale,
+ sh / 2.0 - (cy + 2 * ymin - old_ymin) * scale,
sw, sh, scale, &old_cr, &stride);
img_new = cro_img(new,
- -scale * cx + sw / 2.0 - (2 * xmin - new_xmin) * scale,
- -scale * cy + sh / 2.0 - (2 * ymin - new_ymin) * scale,
+ sw / 2.0 - (cx + 2 * xmin - new_xmin) * scale,
+ sh / 2.0 - (cy + 2 * ymin - new_ymin) * scale,
sw, sh, scale, NULL, NULL);
struct diff diff = {