diff options
author | Keith Packard <keithp@keithp.com> | 2009-02-25 10:12:23 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-02-25 11:12:43 -0800 |
commit | e59aa804df8a39541aa3224a5e688b819196070c (patch) | |
tree | 631cb435c3e93bcb7b4c560ab4ff8f9cec333bea | |
parent | 9a59e7f304ab19c91738311bb9f1ec7709fc8847 (diff) |
RandR rotations and reflections offset by one pixel
The matrix computation for rotation and reflection resulted in dropping a
row or column of pixels as the offsets used in the matrix computations used
width and height rather than width-1 and height-1.
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 77c7a64e8885696665556c9fbcb3cffb552e367a)
-rw-r--r-- | randr/rrtransform.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/randr/rrtransform.c b/randr/rrtransform.c index 49be2e087..8bdff5ab6 100644 --- a/randr/rrtransform.c +++ b/randr/rrtransform.c @@ -185,21 +185,21 @@ RRTransformCompute (int x, break; case RR_Rotate_90: f_rot_cos = 0; f_rot_sin = 1; - f_rot_dx = height; f_rot_dy = 0; + f_rot_dx = height-1; f_rot_dy = 0; rot_cos = F ( 0); rot_sin = F ( 1); - rot_dx = F ( height); rot_dy = F (0); + rot_dx = F (height-1); rot_dy = F (0); break; case RR_Rotate_180: f_rot_cos = -1; f_rot_sin = 0; - f_rot_dx = width; f_rot_dy = height; + f_rot_dx = width - 1; f_rot_dy = height - 1; rot_cos = F (-1); rot_sin = F ( 0); - rot_dx = F (width); rot_dy = F ( height); + rot_dx = F (width-1); rot_dy = F ( height-1); break; case RR_Rotate_270: f_rot_cos = 0; f_rot_sin = -1; - f_rot_dx = 0; f_rot_dy = width; + f_rot_dx = 0; f_rot_dy = width-1; rot_cos = F ( 0); rot_sin = F (-1); - rot_dx = F ( 0); rot_dy = F ( width); + rot_dx = F ( 0); rot_dy = F ( width-1); break; } @@ -222,11 +222,11 @@ RRTransformCompute (int x, f_scale_x = -1; scale_x = F(-1); if (rotation & (RR_Rotate_0|RR_Rotate_180)) { - f_scale_dx = width; - scale_dx = F(width); + f_scale_dx = width-1; + scale_dx = F(width-1); } else { - f_scale_dx = height; - scale_dx = F(height); + f_scale_dx = height-1; + scale_dx = F(height-1); } } if (rotation & RR_Reflect_Y) @@ -234,11 +234,11 @@ RRTransformCompute (int x, f_scale_y = -1; scale_y = F(-1); if (rotation & (RR_Rotate_0|RR_Rotate_180)) { - f_scale_dy = height; - scale_dy = F(height); + f_scale_dy = height-1; + scale_dy = F(height-1); } else { - f_scale_dy = width; - scale_dy = F(width); + f_scale_dy = width-1; + scale_dy = F(width-1); } } |