gimp r25004 - in trunk: . app/tools



Author: martinn
Date: Sat Mar  1 12:51:23 2008
New Revision: 25004
URL: http://svn.gnome.org/viewvc/gimp?rev=25004&view=rev

Log:
2008-03-01  Martin Nordholts  <martinn svn gnome org>

	* app/tools/gimppolygonselecttool.c
	(gimp_polygon_select_tool_draw): Only draw the grabbed point, not
	all points. Drawing all points adds unnecessary clutter to the
	user interface.
	(gimp_polygon_select_tool_select_closest_point): Handle drawing of
	grabbed points.


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

Modified: trunk/app/tools/gimppolygonselecttool.c
==============================================================================
--- trunk/app/tools/gimppolygonselecttool.c	(original)
+++ trunk/app/tools/gimppolygonselecttool.c	Sat Mar  1 12:51:23 2008
@@ -511,17 +511,16 @@
 gimp_polygon_select_tool_draw (GimpDrawTool *draw_tool)
 {
   GimpPolygonSelectTool *poly_sel_tool = GIMP_POLYGON_SELECT_TOOL (draw_tool);
-  gint                   i;
 
   gimp_draw_tool_draw_lines (draw_tool,
                              poly_sel_tool->points, poly_sel_tool->n_points,
                              FALSE, FALSE);
 
-  for (i = 0; i < poly_sel_tool->n_points; i++)
+  if (poly_sel_tool->grabbed_point)
     {
       gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_CIRCLE,
-                                  poly_sel_tool->points[i].x,
-                                  poly_sel_tool->points[i].y,
+                                  poly_sel_tool->grabbed_point->x,
+                                  poly_sel_tool->grabbed_point->y,
                                   HANDLE_SIZE, HANDLE_SIZE,
                                   GTK_ANCHOR_CENTER, FALSE);
     }
@@ -611,10 +610,9 @@
 {
   GimpDrawTool *draw_tool     = GIMP_DRAW_TOOL (poly_sel_tool);
   gdouble       shortest_dist = POINT_GRAB_THRESHOLD_SQ;
+  GimpVector2  *grabbed_point = NULL;
   int           i;
 
-  poly_sel_tool->grabbed_point = NULL;
-
   for (i = 0; i < poly_sel_tool->n_points; i++)
     {
       gdouble dist;
@@ -628,9 +626,18 @@
 
       if (dist < shortest_dist)
         {
-          poly_sel_tool->grabbed_point = &poly_sel_tool->points[i];
+          grabbed_point = &poly_sel_tool->points[i];
         }
     }
+
+  if (grabbed_point != poly_sel_tool->grabbed_point)
+    {
+      gimp_draw_tool_pause(draw_tool);
+
+      poly_sel_tool->grabbed_point = grabbed_point;
+
+      gimp_draw_tool_resume(draw_tool);
+    }
 }
 
 static gboolean



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