1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-30 00:22:27 +02:00

eeshow/diff.c (diff_to_canvas): simplify offset calculation

This commit is contained in:
Werner Almesberger 2016-08-09 12:08:08 -03:00
parent d4e3018c12
commit cc3befe110

View File

@ -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. * be eager to mark with big yellow boxes.
*/ */
img_old = cro_img(old, img_old = cro_img(old,
-scale * cx + sw / 2.0 - (2 * xmin - old_xmin) * scale, sw / 2.0 - (cx + 2 * xmin - old_xmin) * scale,
-scale * cy + sh / 2.0 - (2 * ymin - old_ymin) * scale, sh / 2.0 - (cy + 2 * ymin - old_ymin) * scale,
sw, sh, scale, &old_cr, &stride); sw, sh, scale, &old_cr, &stride);
img_new = cro_img(new, img_new = cro_img(new,
-scale * cx + sw / 2.0 - (2 * xmin - new_xmin) * scale, sw / 2.0 - (cx + 2 * xmin - new_xmin) * scale,
-scale * cy + sh / 2.0 - (2 * ymin - new_ymin) * scale, sh / 2.0 - (cy + 2 * ymin - new_ymin) * scale,
sw, sh, scale, NULL, NULL); sw, sh, scale, NULL, NULL);
struct diff diff = { struct diff diff = {