added some comments.

2007-01-22  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintbrush.c: added some comments.

	* app/paint/gimppaintcore.c: sprinkled with const qualifiers.


svn path=/trunk/; revision=21756
This commit is contained in:
Sven Neumann
2007-01-22 17:24:17 +00:00
committed by Sven Neumann
parent 0e55a7f5f7
commit 125c3d9632
3 changed files with 37 additions and 30 deletions

View File

@ -1,3 +1,9 @@
2007-01-22 Sven Neumann <sven@gimp.org>
* app/paint/gimppaintbrush.c: added some comments.
* app/paint/gimppaintcore.c: sprinkled with const qualifiers.
2007-01-22 Sven Neumann <sven@gimp.org> 2007-01-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdatafactoryview.c: don't add the open-as-image * app/widgets/gimpdatafactoryview.c: don't add the open-as-image

View File

@ -127,6 +127,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
if (! area) if (! area)
return; return;
/* optionally take the color from the current gradient */
if (gimp_paint_options_get_gradient_color (paint_options, image, if (gimp_paint_options_get_gradient_color (paint_options, image,
paint_core->cur_coords.pressure, paint_core->cur_coords.pressure,
paint_core->pixel_dist, paint_core->pixel_dist,
@ -146,9 +147,9 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
paint_appl_mode = GIMP_PAINT_INCREMENTAL; paint_appl_mode = GIMP_PAINT_INCREMENTAL;
} }
/* otherwise check if the brush has a pixmap and use that to color the area */
else if (brush_core->brush && brush_core->brush->pixmap) else if (brush_core->brush && brush_core->brush->pixmap)
{ {
/* if it's a pixmap, do pixmap stuff */
gimp_brush_core_color_area_with_pixmap (brush_core, image, drawable, gimp_brush_core_color_area_with_pixmap (brush_core, image, drawable,
area, area,
brush_core->scale, brush_core->scale,
@ -156,6 +157,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
paint_appl_mode = GIMP_PAINT_INCREMENTAL; paint_appl_mode = GIMP_PAINT_INCREMENTAL;
} }
/* otherwise fill the area with the foreground color */
else else
{ {
gimp_image_get_foreground (image, context, gimp_drawable_type (drawable), gimp_image_get_foreground (image, context, gimp_drawable_type (drawable),
@ -171,6 +173,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
if (pressure_options->opacity) if (pressure_options->opacity)
opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure; opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure;
/* finally, let the brush core paste the colored area on the canvas */
gimp_brush_core_paste_canvas (brush_core, drawable, gimp_brush_core_paste_canvas (brush_core, drawable,
MIN (opacity, GIMP_OPACITY_OPAQUE), MIN (opacity, GIMP_OPACITY_OPAQUE),
gimp_context_get_opacity (context), gimp_context_get_opacity (context),

View File

@ -580,7 +580,7 @@ gimp_paint_core_get_orig_image (GimpPaintCore *core,
gint pixelwidth; gint pixelwidth;
gint drawable_width; gint drawable_width;
gint drawable_height; gint drawable_height;
guchar *s; const guchar *s;
guchar *d; guchar *d;
gpointer pr; gpointer pr;
@ -629,9 +629,8 @@ gimp_paint_core_get_orig_image (GimpPaintCore *core,
undo_tile = tile_manager_get_tile (core->undo_tiles, undo_tile = tile_manager_get_tile (core->undo_tiles,
srcPR.x, srcPR.y, srcPR.x, srcPR.y,
TRUE, FALSE); TRUE, FALSE);
s = (guchar *) tile_data_pointer (undo_tile, s = tile_data_pointer (undo_tile,
srcPR.x % TILE_WIDTH, srcPR.x % TILE_WIDTH, srcPR.y % TILE_HEIGHT);
srcPR.y % TILE_HEIGHT);
} }
else else
{ {
@ -677,7 +676,7 @@ gimp_paint_core_get_orig_proj (GimpPaintCore *core,
gint pixelwidth; gint pixelwidth;
gint pickable_width; gint pickable_width;
gint pickable_height; gint pickable_height;
guchar *s; const guchar *s;
guchar *d; guchar *d;
gpointer pr; gpointer pr;
@ -728,9 +727,8 @@ gimp_paint_core_get_orig_proj (GimpPaintCore *core,
saved_tile = tile_manager_get_tile (core->saved_proj_tiles, saved_tile = tile_manager_get_tile (core->saved_proj_tiles,
srcPR.x, srcPR.y, srcPR.x, srcPR.y,
TRUE, FALSE); TRUE, FALSE);
s = (guchar *) tile_data_pointer (saved_tile, s = tile_data_pointer (saved_tile,
srcPR.x % TILE_WIDTH, srcPR.x % TILE_WIDTH, srcPR.y % TILE_HEIGHT);
srcPR.y % TILE_HEIGHT);
} }
else else
{ {