gimp r25639 - in trunk: . app/tools
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25639 - in trunk: . app/tools
- Date: Sun, 11 May 2008 14:01:25 +0100 (BST)
Author: martinn
Date: Sun May 11 13:01:24 2008
New Revision: 25639
URL: http://svn.gnome.org/viewvc/gimp?rev=25639&view=rev
Log:
2008-05-11 Martin Nordholts <martinn svn gnome org>
* app/tools/gimprectangletool.c: Fix emission of
rectangle-change-complete signals.
* app/tools/gimpcroptool.c
* app/tools/gimprectangleselecttool.c:
Use the rectangle-change-complete signal to update the default
aspect ratio. Fixes bug #530519.
* app/tools/gimpcroptool.c
(gimp_crop_tool_button_release)
(gimp_crop_tool_options_notify)
* app/tools/gimprectangleselecttool.c
(gimp_rectangle_select_tool_button_release): No need to explicitly
update option defaults since it is handled through the
rectangle-change-complete signal now.
Modified:
trunk/ChangeLog
trunk/app/tools/gimpcroptool.c
trunk/app/tools/gimprectangleselecttool.c
trunk/app/tools/gimprectangletool.c
Modified: trunk/app/tools/gimpcroptool.c
==============================================================================
--- trunk/app/tools/gimpcroptool.c (original)
+++ trunk/app/tools/gimpcroptool.c Sun May 11 13:01:24 2008
@@ -89,6 +89,7 @@
GimpContext *context);
static void gimp_crop_tool_image_size_changed (GimpCropTool *crop_tool);
static void gimp_crop_tool_cancel (GimpRectangleTool *rect_tool);
+static gboolean gimp_crop_tool_rectangle_change_complete (GimpRectangleTool *rect_tool);
G_DEFINE_TYPE_WITH_CODE (GimpCropTool, gimp_crop_tool, GIMP_TYPE_DRAW_TOOL,
@@ -145,8 +146,9 @@
static void
gimp_crop_tool_rectangle_tool_iface_init (GimpRectangleToolInterface *iface)
{
- iface->execute = gimp_crop_tool_execute;
- iface->cancel = gimp_crop_tool_cancel;
+ iface->execute = gimp_crop_tool_execute;
+ iface->cancel = gimp_crop_tool_cancel;
+ iface->rectangle_change_complete = gimp_crop_tool_rectangle_change_complete;
}
static void
@@ -257,10 +259,6 @@
state,
release_type,
display);
-
- gimp_crop_tool_update_option_defaults (GIMP_CROP_TOOL (tool),
- FALSE);
-
}
static void
@@ -322,6 +320,20 @@
}
/**
+ * gimp_crop_tool_rectangle_change_complete:
+ * @rectangle:
+ *
+ * Returns:
+ **/
+static gboolean
+gimp_crop_tool_rectangle_change_complete (GimpRectangleTool *rectangle)
+{
+ gimp_crop_tool_update_option_defaults (GIMP_CROP_TOOL (rectangle), FALSE);
+
+ return TRUE;
+}
+
+/**
* gimp_crop_tool_update_option_defaults:
* @crop_tool:
* @ignore_pending: %TRUE to ignore any pending crop rectangle.
@@ -397,9 +409,6 @@
{
gimp_rectangle_tool_set_constraint (GIMP_RECTANGLE_TOOL (crop_tool),
gimp_crop_tool_get_constraint (crop_tool));
-
- gimp_crop_tool_update_option_defaults (crop_tool,
- FALSE);
}
static void
Modified: trunk/app/tools/gimprectangleselecttool.c
==============================================================================
--- trunk/app/tools/gimprectangleselecttool.c (original)
+++ trunk/app/tools/gimprectangleselecttool.c Sun May 11 13:01:24 2008
@@ -492,8 +492,6 @@
}
priv->redo = NULL;
-
- gimp_rectangle_select_tool_update_option_defaults (rect_sel_tool, FALSE);
}
static void
@@ -891,6 +889,8 @@
gimp_tool_control_set_preserve (tool->control, FALSE);
+ gimp_rectangle_select_tool_update_option_defaults (rect_sel_tool, FALSE);
+
return TRUE;
}
Modified: trunk/app/tools/gimprectangletool.c
==============================================================================
--- trunk/app/tools/gimprectangletool.c (original)
+++ trunk/app/tools/gimprectangletool.c Sun May 11 13:01:24 2008
@@ -1207,8 +1207,6 @@
private->lasty);
gimp_rectangle_tool_update_highlight (rect_tool);
-
- gimp_rectangle_tool_rectangle_change_complete (rect_tool);
}
}
@@ -1227,7 +1225,14 @@
gimp_rectangle_tool_update_highlight (rect_tool);
- gimp_rectangle_tool_rectangle_change_complete (rect_tool);
+ /* Only emit the rectangle-changed signal if the button is
+ * not down. If it is down, the signal will and shall be
+ * emited on _button_release instead.
+ */
+ if (! button1_down)
+ {
+ gimp_rectangle_tool_rectangle_change_complete (rect_tool);
+ }
}
else if (button1_down)
{
@@ -1242,8 +1247,6 @@
private->other_side_y);
gimp_rectangle_tool_update_highlight (rect_tool);
-
- gimp_rectangle_tool_rectangle_change_complete (rect_tool);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]