Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0902fe

Browse files
committed
Fix bug with using the distortion table for nonaffine transformations
1 parent 23656e8 commit a0902fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_image_resample.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ class lookup_distortion
584584
if (dx >= 0 && dx < m_out_width &&
585585
dy >= 0 && dy < m_out_height) {
586586
const double *coord = m_mesh + (int(dy) * m_out_width + int(dx)) * 2;
587-
*x = int(coord[0] * agg::image_subpixel_scale);
588-
*y = int(coord[1] * agg::image_subpixel_scale);
587+
*x = int(coord[0] * agg::image_subpixel_scale + 0.5); // round
588+
*y = int(coord[1] * agg::image_subpixel_scale + 0.5); // round
589589
}
590590
}
591591
}

0 commit comments

Comments
 (0)