summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-09 10:20:46 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-09 10:20:46 -0300
commit34d7e31f53110b0b4de3d3c51faa8103600b4a3f (patch)
tree53d45a91ae4245cef6a8839e122c1d3aee946dfc /diff.c
parent6d17496f1a93a3895cfd4195a7afe0f37cc53ba3 (diff)
downloadeeshow-34d7e31f53110b0b4de3d3c51faa8103600b4a3f.tar.gz
eeshow-34d7e31f53110b0b4de3d3c51faa8103600b4a3f.tar.bz2
eeshow-34d7e31f53110b0b4de3d3c51faa8103600b4a3f.zip
eeshow/diff.c (diff_to_canvas): point out flaw in offset calculation
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 251863f..728198e 100644
--- a/diff.c
+++ b/diff.c
@@ -323,6 +323,12 @@ 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 should handle offset differences (xmin - old_xmin, et al.)
+ * before scaling. Else we risk rounding differences to lead to
+ * single-pixel differences, which the differences algorithm will
+ * 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,