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> 2006-04-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch]: added struct GimpArray which can * 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; GimpImage *image;
gint max_x, max_y; gint max_x, max_y;
gboolean rectangle_exists; gboolean rectangle_exists;
gboolean auto_shrink;
gboolean selected; gboolean selected;
gint val; gint val;
GimpChannel *selection_mask; GimpChannel *selection_mask;
@ -315,23 +316,30 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle,
x + w >= 0 && y + h >= 0 && x + w >= 0 && y + h >= 0 &&
w > 0 && h > 0); w > 0 && h > 0);
if (x < 0) g_object_get (options,
{ "auto-shrink", &auto_shrink,
w += x; NULL);
x = 0;
}
if (y < 0) if (auto_shrink)
{ {
h += y; if (x < 0)
y = 0; {
} w += x;
x = 0;
}
if (x + w > max_x) if (y < 0)
w = max_x - x; {
h += y;
y = 0;
}
if (y + h > max_y) if (x + w > max_x)
h = max_y - y; w = max_x - x;
if (y + h > max_y)
h = max_y - y;
}
/* if rectangle exists, turn it into a selection */ /* if rectangle exists, turn it into a selection */
if (rectangle_exists) if (rectangle_exists)

View File

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