Commit 8a5ee944 authored by Ell's avatar Ell

Issue #2405 - Rotation center shifts by half a pixel ...

... the second time you do a 180 degrees rotation

In gimp_transform_resize_adjust(), nudge the transformed layer
boundary by EPSILON toward the center, to avoid enlarging the layer
unnecessarily, as a result of numeric error amplified by rounding,
when the tranformed boundary should land on integer coordinates.
In particular, this avoids enlarging the layer when rotating by 180

(cherry picked from commit c271992a)
parent f46de793
......@@ -233,11 +233,11 @@ gimp_transform_resize_adjust (const GimpVector2 *points,
bottom_right.y = MAX (bottom_right.y, points[i].y);
*x1 = (gint) floor (top_left.x);
*y1 = (gint) floor (top_left.y);
*x1 = (gint) floor (top_left.x + EPSILON);
*y1 = (gint) floor (top_left.y + EPSILON);
*x2 = (gint) ceil (bottom_right.x);
*y2 = (gint) ceil (bottom_right.y);
*x2 = (gint) ceil (bottom_right.x - EPSILON);
*y2 = (gint) ceil (bottom_right.y - EPSILON);
static void
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment