don't automatically auto-shrink.

2006-04-01  Karine Delvare  <edhel@gimp.org>

	* app/tools/gimpnewrectselecttool.c: don't automatically
	auto-shrink.
This commit is contained in:
Karine Delvare 2006-04-01 10:46:21 +00:00 committed by Karine Delvare
parent d05d512d9c
commit a10a5713d7
3 changed files with 49 additions and 28 deletions

View File

@ -1,3 +1,8 @@
2006-04-01 Karine Delvare <edhel@gimp.org>
* app/tools/gimpnewrectselecttool.c: don't automatically
auto-shrink.
2006-04-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch]: added struct GimpArray which can

View File

@ -294,6 +294,7 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle,
GimpImage *image;
gint max_x, max_y;
gboolean rectangle_exists;
gboolean auto_shrink;
gboolean selected;
gint val;
GimpChannel *selection_mask;
@ -315,23 +316,30 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle,
x + w >= 0 && y + h >= 0 &&
w > 0 && h > 0);
if (x < 0)
{
w += x;
x = 0;
}
g_object_get (options,
"auto-shrink", &auto_shrink,
NULL);
if (y < 0)
{
h += y;
y = 0;
}
if (auto_shrink)
{
if (x < 0)
{
w += x;
x = 0;
}
if (x + w > max_x)
w = max_x - x;
if (y < 0)
{
h += y;
y = 0;
}
if (y + h > max_y)
h = max_y - y;
if (x + w > max_x)
w = max_x - x;
if (y + h > max_y)
h = max_y - y;
}
/* if rectangle exists, turn it into a selection */
if (rectangle_exists)

View File

@ -294,6 +294,7 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle,
GimpImage *image;
gint max_x, max_y;
gboolean rectangle_exists;
gboolean auto_shrink;
gboolean selected;
gint val;
GimpChannel *selection_mask;
@ -315,23 +316,30 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle,
x + w >= 0 && y + h >= 0 &&
w > 0 && h > 0);
if (x < 0)
{
w += x;
x = 0;
}
g_object_get (options,
"auto-shrink", &auto_shrink,
NULL);
if (y < 0)
{
h += y;
y = 0;
}
if (auto_shrink)
{
if (x < 0)
{
w += x;
x = 0;
}
if (x + w > max_x)
w = max_x - x;
if (y < 0)
{
h += y;
y = 0;
}
if (y + h > max_y)
h = max_y - y;
if (x + w > max_x)
w = max_x - x;
if (y + h > max_y)
h = max_y - y;
}
/* if rectangle exists, turn it into a selection */
if (rectangle_exists)