gimp r25526 - in trunk: . app/paint



Author: mitch
Date: Fri Apr 25 13:39:36 2008
New Revision: 25526
URL: http://svn.gnome.org/viewvc/gimp?rev=25526&view=rev

Log:
2008-04-25  Michael Natterer  <mitch gimp org>

	* app/paint/gimppaintoptions.c (gimp_paint_options_get_jitter):
	add g_return_if_fail().

	* app/paint/gimpheal.c (gimp_heal_motion)
	* app/paint/gimpdodgeburn.c (gimp_dodge_burn_motion): free stuff
	right after it's not used any longer, instead of at the end of the
	function.

	* app/paint/gimppaintbrush.c (_gimp_paintbrush_motion): move a
	statement to improve consistency with other motion() functions.



Modified:
   trunk/ChangeLog
   trunk/app/paint/gimpdodgeburn.c
   trunk/app/paint/gimpheal.c
   trunk/app/paint/gimppaintbrush.c
   trunk/app/paint/gimppaintoptions.c

Modified: trunk/app/paint/gimpdodgeburn.c
==============================================================================
--- trunk/app/paint/gimpdodgeburn.c	(original)
+++ trunk/app/paint/gimpdodgeburn.c	Fri Apr 25 13:39:36 2008
@@ -234,6 +234,8 @@
   else
     copy_region (&tempPR, &destPR);
 
+  g_free (temp_data);
+
   if (pressure_options->opacity)
     opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure;
 
@@ -243,8 +245,6 @@
                                   gimp_context_get_opacity (context),
                                   gimp_paint_options_get_brush_mode (paint_options),
                                   GIMP_PAINT_CONSTANT);
-
-  g_free (temp_data);
 }
 
 static void

Modified: trunk/app/paint/gimpheal.c
==============================================================================
--- trunk/app/paint/gimpheal.c	(original)
+++ trunk/app/paint/gimpheal.c	Fri Apr 25 13:39:36 2008
@@ -531,11 +531,15 @@
   /* heal tempPR using srcPR */
   gimp_heal_region (&tempPR, srcPR, mask_buf);
 
+  temp_buf_free (src);
+
   /* reinitialize tempPR */
   pixel_region_init_temp_buf (&tempPR, temp, 0, 0, temp->width, temp->height);
 
   copy_region (&tempPR, &destPR);
 
+  temp_buf_free (temp);
+
   /* check the brush pressure */
   if (paint_options->pressure_options->opacity)
     opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure;
@@ -547,7 +551,4 @@
                                   gimp_context_get_opacity (context),
                                   gimp_paint_options_get_brush_mode (paint_options),
                                   GIMP_PAINT_INCREMENTAL);
-
-  temp_buf_free (src);
-  temp_buf_free (temp);
 }

Modified: trunk/app/paint/gimppaintbrush.c
==============================================================================
--- trunk/app/paint/gimppaintbrush.c	(original)
+++ trunk/app/paint/gimppaintbrush.c	Fri Apr 25 13:39:36 2008
@@ -121,12 +121,12 @@
   if (opacity == 0.0)
     return;
 
-  paint_appl_mode = paint_options->application_mode;
-
   area = gimp_paint_core_get_paint_area (paint_core, drawable, paint_options);
   if (! area)
     return;
 
+  paint_appl_mode = paint_options->application_mode;
+
   /* optionally take the color from the current gradient */
   if (gimp_paint_options_get_gradient_color (paint_options, image,
                                              paint_core->cur_coords.pressure,

Modified: trunk/app/paint/gimppaintoptions.c
==============================================================================
--- trunk/app/paint/gimppaintoptions.c	(original)
+++ trunk/app/paint/gimppaintoptions.c	Fri Apr 25 13:39:36 2008
@@ -611,6 +611,8 @@
 {
   GimpJitterOptions *jitter_options;
 
+  g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), 0.0);
+
   jitter_options = paint_options->jitter_options;
 
   if (jitter_options->use_jitter)



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