From 8febb99bf99977cda2af388ffac5a050bbbab361 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 5 Aug 2014 22:19:07 +0200 Subject: [PATCH] Use src_rotated_origin to create src_rotated_point. --- rotation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rotation.cpp b/rotation.cpp index 0ab9efd..b241d29 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -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;