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>
This commit is contained in:
parent
4e8d98b61e
commit
77c7a64e88
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user