Use src_rotated_origin to create src_rotated_point.

This commit is contained in:
Fabien Freling 2014-08-05 22:19:07 +02:00
parent 9dbaafece1
commit 8febb99bf9

View file

@ -341,10 +341,11 @@ Image* rotate(Image const& src, double angle)
int const width = rotated->width;
int const height = rotated->height;
Point src_rotated_origin(rot_origin_in_src.x * q_pos,
rot_origin_in_src.y * q_pos);
for (int y = 0; y < height; ++y)
{
Point src_rotated_point((rot_origin_in_src.x * q_pos) + y * qdy.x,
(rot_origin_in_src.y * q_pos) + y * qdy.y);
Point src_rotated_point = src_rotated_origin;
for (int x = 0; x < width; ++x)
{
@ -360,6 +361,7 @@ Image* rotate(Image const& src, double angle)
src_rotated_point += qdx;
buffer_index += 1; // pixel_size
}
src_rotated_origin += qdy;
}
return rotated;