From a10a5713d7daf67b64992f42e1ef5109a7efbd45 Mon Sep 17 00:00:00 2001 From: Karine Delvare Date: Sat, 1 Apr 2006 10:46:21 +0000 Subject: [PATCH] don't automatically auto-shrink. 2006-04-01 Karine Delvare * app/tools/gimpnewrectselecttool.c: don't automatically auto-shrink. --- ChangeLog | 5 ++++ app/tools/gimpnewrectselecttool.c | 36 ++++++++++++++++++----------- app/tools/gimprectangleselecttool.c | 36 ++++++++++++++++++----------- 3 files changed, 49 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1761952185..c3301e6503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-01 Karine Delvare + + * app/tools/gimpnewrectselecttool.c: don't automatically + auto-shrink. + 2006-04-01 Michael Natterer * app/core/gimpparamspecs.[ch]: added struct GimpArray which can diff --git a/app/tools/gimpnewrectselecttool.c b/app/tools/gimpnewrectselecttool.c index c92091ef9c..edbea68129 100644 --- a/app/tools/gimpnewrectselecttool.c +++ b/app/tools/gimpnewrectselecttool.c @@ -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) diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c index c92091ef9c..edbea68129 100644 --- a/app/tools/gimprectangleselecttool.c +++ b/app/tools/gimprectangleselecttool.c @@ -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)