summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-09 11:21:52 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-09 11:21:52 -0300
commitaecc45f94656bc9075899b82e2fcd3546370e254 (patch)
tree334d9b3b1d1a8221dc300fe6935ab73ac89d977b /diff.c
parentffc332e622558a8b03e338d318b9a2f9ff59d22d (diff)
downloadeeshow-aecc45f94656bc9075899b82e2fcd3546370e254.tar.gz
eeshow-aecc45f94656bc9075899b82e2fcd3546370e254.tar.bz2
eeshow-aecc45f94656bc9075899b82e2fcd3546370e254.zip
eeshow/diff.c (diff_to_canvas): fix 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 2eee314..dcd6187 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 - (xmin - old_xmin) * scale,
- -scale * cy + sh / 2.0 - (ymin - old_ymin) * scale,
+ -scale * cx + sw / 2.0 - (2 * xmin - old_xmin) * scale,
+ -scale * cy + sh / 2.0 - (2 * ymin - old_ymin) * scale,
sw, sh, scale, &old_cr, &stride);
img_new = cro_img(new,
- -scale * cx + sw / 2.0 - (xmin - new_xmin) * scale,
- -scale * cy + sh / 2.0 - (ymin - new_ymin) * scale,
+ -scale * cx + sw / 2.0 - (2 * xmin - new_xmin) * scale,
+ -scale * cy + sh / 2.0 - (2 * ymin - new_ymin) * scale,
sw, sh, scale, NULL, NULL);
struct diff diff = {