app: add incremental mode to the Dodge/Burn tool
Add an "Incremental" option to the Dodge/Burn tool, which, similarly to the Paintbrush, Pencil, and Eraser tools, applies the effect incrementally as the pointer moves.
This commit is contained in:
@ -116,6 +116,7 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core,
|
||||
GimpContext *context = GIMP_CONTEXT (paint_options);
|
||||
GimpDynamics *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics;
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GeglBuffer *src_buffer;
|
||||
GeglBuffer *paint_buffer;
|
||||
gint paint_buffer_x;
|
||||
gint paint_buffer_y;
|
||||
@ -140,6 +141,11 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core,
|
||||
if (opacity == 0.0)
|
||||
return;
|
||||
|
||||
if (paint_options->application_mode == GIMP_PAINT_CONSTANT)
|
||||
src_buffer = gimp_paint_core_get_orig_image (paint_core);
|
||||
else
|
||||
src_buffer = gimp_drawable_get_buffer (drawable);
|
||||
|
||||
gimp_brush_core_eval_transform_dynamics (GIMP_BRUSH_CORE (paint_core),
|
||||
drawable,
|
||||
paint_options,
|
||||
@ -165,7 +171,7 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core,
|
||||
paint_height);
|
||||
|
||||
/* DodgeBurn the region */
|
||||
gimp_gegl_dodgeburn (gimp_paint_core_get_orig_image (paint_core),
|
||||
gimp_gegl_dodgeburn (src_buffer,
|
||||
GEGL_RECTANGLE (paint_buffer_x,
|
||||
paint_buffer_y,
|
||||
gegl_buffer_get_width (paint_buffer),
|
||||
@ -192,6 +198,7 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core,
|
||||
gimp_context_get_opacity (context),
|
||||
gimp_paint_options_get_brush_mode (paint_options),
|
||||
force,
|
||||
GIMP_PAINT_CONSTANT, op);
|
||||
paint_options->application_mode,
|
||||
op);
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +259,8 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
|
||||
/* the "incremental" toggle */
|
||||
if (tool_type == GIMP_TYPE_PENCIL_TOOL ||
|
||||
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
|
||||
tool_type == GIMP_TYPE_ERASER_TOOL)
|
||||
tool_type == GIMP_TYPE_ERASER_TOOL ||
|
||||
tool_type == GIMP_TYPE_DODGE_BURN_TOOL)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
||||
|
Reference in New Issue
Block a user