diff --git a/rotation.cpp b/rotation.cpp index 4916167..0341e9f 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -588,8 +588,8 @@ Image* rotate(Image const& src, double angle) // TODO: compact these structure to increase locality int const left_padding = padding_table[y]; int const left_border = 0; - int const right_padding = 0; int const right_border = 0; + int const right_padding = min((int) padding_table[height - 1 - y], (int) width - left_padding); int const core_pixels = width - left_padding - left_border - right_border - right_padding; if (false)