gimp r25798 - in trunk: . app/tools



Author: martinn
Date: Sun May 25 17:35:52 2008
New Revision: 25798
URL: http://svn.gnome.org/viewvc/gimp?rev=25798&view=rev

Log:
2008-05-25  Martin Nordholts  <martinn svn gnome org>

	* app/tools/gimpfreeselecttool.c
	(gimp_free_select_tool_prepare_for_move)
	(gimp_free_select_tool_revert_to_saved_state)
	(gimp_free_select_tool_move_segment_vertex_to): Handle the special
	case when there is only one point, so that moving segment vertices
	works even if there only is one.


Modified:
   trunk/ChangeLog
   trunk/app/tools/gimpfreeselecttool.c

Modified: trunk/app/tools/gimpfreeselecttool.c
==============================================================================
--- trunk/app/tools/gimpfreeselecttool.c	(original)
+++ trunk/app/tools/gimpfreeselecttool.c	Sun May 25 17:35:52 2008
@@ -725,6 +725,14 @@
                                          priv->saved_points_higher_segment,
                                          n_points);
     }
+
+  /* Handle when there only is one point */
+  if (segment_index == 0 &&
+      priv->n_segment_indices == 1)
+    {
+      priv->points[0].x = new_x;
+      priv->points[0].y = new_y;
+    }
 }
 
 /**
@@ -812,6 +820,12 @@
               priv->saved_points_higher_segment,
               sizeof (GimpVector2) * n_points);
     }
+
+  if (priv->grabbed_segment_index == 0 &&
+      priv->n_segment_indices     == 1)
+    {
+      priv->points[0] = *priv->saved_points_lower_segment;
+    }
 }
 
 static void
@@ -939,6 +953,14 @@
               source,
               sizeof (GimpVector2) * n_points);
     }
+
+  /* A special-case when there only is one point */
+  if (priv->grabbed_segment_index == 0 &&
+      priv->n_segment_indices     == 1)
+    {
+      priv->saved_points_lower_segment  = g_new0 (GimpVector2, 1);
+      *priv->saved_points_lower_segment = priv->points[0];
+    }
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]