Use src_rotated_origin to create src_rotated_point.
This commit is contained in:
parent
9dbaafece1
commit
8febb99bf9
|
@ -341,10 +341,11 @@ Image* rotate(Image const& src, double angle)
|
||||||
int const width = rotated->width;
|
int const width = rotated->width;
|
||||||
int const height = rotated->height;
|
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)
|
for (int y = 0; y < height; ++y)
|
||||||
{
|
{
|
||||||
Point src_rotated_point((rot_origin_in_src.x * q_pos) + y * qdy.x,
|
Point src_rotated_point = src_rotated_origin;
|
||||||
(rot_origin_in_src.y * q_pos) + y * qdy.y);
|
|
||||||
|
|
||||||
for (int x = 0; x < width; ++x)
|
for (int x = 0; x < width; ++x)
|
||||||
{
|
{
|
||||||
|
@ -360,6 +361,7 @@ Image* rotate(Image const& src, double angle)
|
||||||
src_rotated_point += qdx;
|
src_rotated_point += qdx;
|
||||||
buffer_index += 1; // pixel_size
|
buffer_index += 1; // pixel_size
|
||||||
}
|
}
|
||||||
|
src_rotated_origin += qdy;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rotated;
|
return rotated;
|
||||||
|
|
Loading…
Reference in a new issue