gimp r24730 - in trunk: . app/display



Author: neo
Date: Mon Jan 28 16:00:30 2008
New Revision: 24730
URL: http://svn.gnome.org/viewvc/gimp?rev=24730&view=rev

Log:
2008-01-28  Sven Neumann  <sven gimp org>

	* app/display/gimpdisplayshell.[ch] (gimp_display_shell_snap_coords):
	removed redundant GimpCoords parameter that use to cause valgrind
	warnings about overlapping memory regions in memcpy().

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-autoscroll.c: changed accordingly.


Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayshell-autoscroll.c
   trunk/app/display/gimpdisplayshell-callbacks.c
   trunk/app/display/gimpdisplayshell.c
   trunk/app/display/gimpdisplayshell.h

Modified: trunk/app/display/gimpdisplayshell-autoscroll.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-autoscroll.c	(original)
+++ trunk/app/display/gimpdisplayshell-autoscroll.c	Mon Jan 28 16:00:30 2008
@@ -154,7 +154,6 @@
 
           gimp_display_shell_snap_coords (shell,
                                           &image_coords,
-                                          &image_coords,
                                           x, y, width, height);
         }
 

Modified: trunk/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.c	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.c	Mon Jan 28 16:00:30 2008
@@ -661,7 +661,6 @@
 
       if (gimp_display_shell_snap_coords (shell,
                                           &image_coords,
-                                          &image_coords,
                                           x, y, width, height))
         {
           update_sw_cursor = TRUE;
@@ -1085,7 +1084,6 @@
 
             if (gimp_display_shell_snap_coords (shell,
                                                 &image_coords,
-                                                &image_coords,
                                                 x, y, width, height))
               {
                 update_sw_cursor = TRUE;
@@ -1145,7 +1143,6 @@
 
                 gimp_display_shell_snap_coords (shell,
                                                 &image_coords,
-                                                &image_coords,
                                                 x, y, width, height);
               }
           }
@@ -1240,7 +1237,6 @@
 
                             gimp_display_shell_snap_coords (shell,
                                                             &image_coords,
-                                                            &image_coords,
                                                             x, y, width, height);
                           }
 

Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c	(original)
+++ trunk/app/display/gimpdisplayshell.c	Mon Jan 28 16:00:30 2008
@@ -1227,32 +1227,31 @@
 gboolean
 gimp_display_shell_snap_coords (GimpDisplayShell *shell,
                                 GimpCoords       *coords,
-                                GimpCoords       *snapped_coords,
                                 gint              snap_offset_x,
                                 gint              snap_offset_y,
                                 gint              snap_width,
                                 gint              snap_height)
 {
-  gboolean snap_to_guides  = FALSE;
-  gboolean snap_to_grid    = FALSE;
-  gboolean snap_to_canvas  = FALSE;
-  gboolean snap_to_vectors = FALSE;
-  gboolean snapped         = FALSE;
+  GimpImage *image;
+  gboolean   snap_to_guides  = FALSE;
+  gboolean   snap_to_grid    = FALSE;
+  gboolean   snap_to_canvas  = FALSE;
+  gboolean   snap_to_vectors = FALSE;
+  gboolean   snapped         = FALSE;
 
   g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
   g_return_val_if_fail (coords != NULL, FALSE);
-  g_return_val_if_fail (snapped_coords != NULL, FALSE);
 
-  *snapped_coords = *coords;
+  image = shell->display->image;
 
   if (gimp_display_shell_get_snap_to_guides (shell) &&
-      gimp_image_get_guides (shell->display->image))
+      gimp_image_get_guides (image))
     {
       snap_to_guides = TRUE;
     }
 
   if (gimp_display_shell_get_snap_to_grid (shell) &&
-      gimp_image_get_grid (shell->display->image))
+      gimp_image_get_grid (image))
     {
       snap_to_grid = TRUE;
     }
@@ -1260,18 +1259,17 @@
   snap_to_canvas = gimp_display_shell_get_snap_to_canvas (shell);
 
   if (gimp_display_shell_get_snap_to_vectors (shell) &&
-      gimp_image_get_active_vectors (shell->display->image))
+      gimp_image_get_active_vectors (image))
     {
       snap_to_vectors = TRUE;
     }
 
   if (snap_to_guides || snap_to_grid || snap_to_canvas || snap_to_vectors)
     {
-      gdouble tx, ty;
       gint    snap_distance;
+      gdouble tx, ty;
 
-      snap_distance =
-        GIMP_DISPLAY_CONFIG (shell->display->image->gimp->config)->snap_distance;
+      snap_distance = GIMP_DISPLAY_CONFIG (image->gimp->config)->snap_distance;
 
       if (snap_width > 0 && snap_height > 0)
         {
@@ -1308,8 +1306,8 @@
 
       if (snapped)
         {
-          snapped_coords->x = tx - snap_offset_x;
-          snapped_coords->y = ty - snap_offset_y;
+          coords->x = tx - snap_offset_x;
+          coords->y = ty - snap_offset_y;
         }
     }
 

Modified: trunk/app/display/gimpdisplayshell.h
==============================================================================
--- trunk/app/display/gimpdisplayshell.h	(original)
+++ trunk/app/display/gimpdisplayshell.h	Mon Jan 28 16:00:30 2008
@@ -221,7 +221,6 @@
 
 gboolean    gimp_display_shell_snap_coords         (GimpDisplayShell   *shell,
                                                     GimpCoords         *coords,
-                                                    GimpCoords         *snapped_coords,
                                                     gint                snap_offset_x,
                                                     gint                snap_offset_y,
                                                     gint                snap_width,



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