mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 12:32:37 +00:00
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:
parent
43b02f10ee
commit
588a77fa2b
|
@ -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>
|
||||
|
||||
* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
|
||||
|
|
|
@ -1108,6 +1108,11 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||
x1 = curx;
|
||||
else
|
||||
y1 = cury;
|
||||
if (fixed_center)
|
||||
{
|
||||
x2 = x1 + 2 * (center_x - x1);
|
||||
y2 = y1 + 2 * (center_y - y1);
|
||||
}
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_UPPER_RIGHT:
|
||||
|
@ -1117,6 +1122,11 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||
x2 = curx;
|
||||
else
|
||||
y1 = cury;
|
||||
if (fixed_center)
|
||||
{
|
||||
x1 = x2 - 2 * (x2 - center_x);
|
||||
y2 = y1 + 2 * (center_y - y1);
|
||||
}
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_LOWER_LEFT:
|
||||
|
@ -1126,6 +1136,11 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||
x1 = curx;
|
||||
else
|
||||
y2 = cury;
|
||||
if (fixed_center)
|
||||
{
|
||||
x2 = x1 + 2 * (center_x - x1);
|
||||
y1 = y2 - 2 * (y2 - center_y);
|
||||
}
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_LOWER_RIGHT:
|
||||
|
@ -1135,10 +1150,17 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||
x2 = curx;
|
||||
else
|
||||
y2 = cury;
|
||||
if (fixed_center)
|
||||
{
|
||||
x1 = x2 - 2 * (x2 - center_x);
|
||||
y1 = y2 - 2 * (y2 - center_y);
|
||||
}
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_TOP:
|
||||
x2 = rx1 + (ry2 - y1) * aspect + .5;
|
||||
if (fixed_center)
|
||||
x1 = x2 - 2 * (x2 - center_x);
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_LEFT:
|
||||
|
@ -1147,10 +1169,14 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||
* and not relevant to the result
|
||||
*/
|
||||
y2 = ry1 + (rx2 - x1) / aspect + .5;
|
||||
if (fixed_center)
|
||||
y1 = y2 - 2 * (y2 - center_y);
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_BOTTOM:
|
||||
x2 = rx1 + (y2 - ry1) * aspect + .5;
|
||||
if (fixed_center)
|
||||
x1 = x2 - 2 * (x2 - center_x);
|
||||
break;
|
||||
|
||||
case RECT_RESIZING_RIGHT:
|
||||
|
@ -1159,6 +1185,8 @@ gimp_rectangle_tool_motion (GimpTool *tool,
|
|||
* and not relevant to the result
|
||||
*/
|
||||
y2 = ry1 + (x2 - rx1) / aspect + 0.5;
|
||||
if (fixed_center)
|
||||
y1 = y2 - 2 * (y2 - center_y);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue