Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion): respect "fixed-center" constraint even if "fixed-aspect" or "aspect-square" constraints are active.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2006-08-22 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
|
* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
|
||||||
|
respect "fixed-center" constraint even if "fixed-aspect"
|
||||||
|
or "aspect-square" constraints are active.
|
||||||
|
|
||||||
2006-08-22 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
2006-08-22 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
|
* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
|
||||||
|
@ -1108,6 +1108,11 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
x1 = curx;
|
x1 = curx;
|
||||||
else
|
else
|
||||||
y1 = cury;
|
y1 = cury;
|
||||||
|
if (fixed_center)
|
||||||
|
{
|
||||||
|
x2 = x1 + 2 * (center_x - x1);
|
||||||
|
y2 = y1 + 2 * (center_y - y1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_UPPER_RIGHT:
|
case RECT_RESIZING_UPPER_RIGHT:
|
||||||
@ -1117,6 +1122,11 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
x2 = curx;
|
x2 = curx;
|
||||||
else
|
else
|
||||||
y1 = cury;
|
y1 = cury;
|
||||||
|
if (fixed_center)
|
||||||
|
{
|
||||||
|
x1 = x2 - 2 * (x2 - center_x);
|
||||||
|
y2 = y1 + 2 * (center_y - y1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_LOWER_LEFT:
|
case RECT_RESIZING_LOWER_LEFT:
|
||||||
@ -1126,6 +1136,11 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
x1 = curx;
|
x1 = curx;
|
||||||
else
|
else
|
||||||
y2 = cury;
|
y2 = cury;
|
||||||
|
if (fixed_center)
|
||||||
|
{
|
||||||
|
x2 = x1 + 2 * (center_x - x1);
|
||||||
|
y1 = y2 - 2 * (y2 - center_y);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_LOWER_RIGHT:
|
case RECT_RESIZING_LOWER_RIGHT:
|
||||||
@ -1135,10 +1150,17 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
x2 = curx;
|
x2 = curx;
|
||||||
else
|
else
|
||||||
y2 = cury;
|
y2 = cury;
|
||||||
|
if (fixed_center)
|
||||||
|
{
|
||||||
|
x1 = x2 - 2 * (x2 - center_x);
|
||||||
|
y1 = y2 - 2 * (y2 - center_y);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_TOP:
|
case RECT_RESIZING_TOP:
|
||||||
x2 = rx1 + (ry2 - y1) * aspect + .5;
|
x2 = rx1 + (ry2 - y1) * aspect + .5;
|
||||||
|
if (fixed_center)
|
||||||
|
x1 = x2 - 2 * (x2 - center_x);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_LEFT:
|
case RECT_RESIZING_LEFT:
|
||||||
@ -1147,10 +1169,14 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
* and not relevant to the result
|
* and not relevant to the result
|
||||||
*/
|
*/
|
||||||
y2 = ry1 + (rx2 - x1) / aspect + .5;
|
y2 = ry1 + (rx2 - x1) / aspect + .5;
|
||||||
|
if (fixed_center)
|
||||||
|
y1 = y2 - 2 * (y2 - center_y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_BOTTOM:
|
case RECT_RESIZING_BOTTOM:
|
||||||
x2 = rx1 + (y2 - ry1) * aspect + .5;
|
x2 = rx1 + (y2 - ry1) * aspect + .5;
|
||||||
|
if (fixed_center)
|
||||||
|
x1 = x2 - 2 * (x2 - center_x);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECT_RESIZING_RIGHT:
|
case RECT_RESIZING_RIGHT:
|
||||||
@ -1159,6 +1185,8 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||||||
* and not relevant to the result
|
* and not relevant to the result
|
||||||
*/
|
*/
|
||||||
y2 = ry1 + (x2 - rx1) / aspect + 0.5;
|
y2 = ry1 + (x2 - rx1) / aspect + 0.5;
|
||||||
|
if (fixed_center)
|
||||||
|
y1 = y2 - 2 * (y2 - center_y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user