[gimp/gimp-2-10] app: add incremental mode to the Dodge/Burn tool
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: add incremental mode to the Dodge/Burn tool
- Date: Wed, 17 Apr 2019 14:03:21 +0000 (UTC)
commit 0ee8e5f17a97367b44f0e547dd53c77f7656e7a0
Author: Ell <ell_se yahoo com>
Date: Wed Apr 17 09:55:35 2019 -0400
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.
(cherry picked from commit 83184d16260ba3e8f0a5920ac439cd4d0dc1efeb)
app/paint/gimpdodgeburn.c | 11 +++++++++--
app/tools/gimppaintoptions-gui.c | 3 ++-
2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c
index 3376ceb9d7..86a9754736 100644
--- a/app/paint/gimpdodgeburn.c
+++ b/app/paint/gimpdodgeburn.c
@@ -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);
}
}
diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
index 23aef019e6..211270f976 100644
--- a/app/tools/gimppaintoptions-gui.c
+++ b/app/tools/gimppaintoptions-gui.c
@@ -258,7 +258,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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]