[gimp] app: make off-canvas changes have effect on brush outline



commit bd2f852ac102b17fc0427502532eeaaf436bbcf6
Author: Alexia Death <alexiadeath gmail com>
Date:   Tue Mar 16 21:51:59 2010 +0200

    app: make off-canvas changes have effect on brush outline

 app/paint/gimpbrushcore.c |    3 ++-
 app/tools/gimpbrushtool.c |   16 +++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index 3bbb770..dc91059 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -1687,7 +1687,8 @@ gimp_brush_core_eval_transform_dynamics (GimpPaintCore     *paint_core,
   core->angle = paint_options->brush_angle;
   core->aspect_ratio = paint_options->brush_aspect_ratio;
 
-  g_return_if_fail (GIMP_IS_DYNAMICS (core->dynamics));
+  if (!GIMP_IS_DYNAMICS (core->dynamics))
+    return;
 
   if (GIMP_BRUSH_CORE_GET_CLASS (core)->handles_dynamic_transforming_brush)
     {
diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c
index 03ace86..e276768 100644
--- a/app/tools/gimpbrushtool.c
+++ b/app/tools/gimpbrushtool.c
@@ -207,6 +207,7 @@ gimp_brush_tool_oper_update (GimpTool         *tool,
 {
   GimpBrushTool    *brush_tool    = GIMP_BRUSH_TOOL (tool);
   GimpPaintOptions *paint_options = GIMP_PAINT_TOOL_GET_OPTIONS (tool);
+  GimpDrawable     *drawable      = gimp_image_get_active_drawable (gimp_display_get_image (display));
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
 
@@ -214,8 +215,7 @@ gimp_brush_tool_oper_update (GimpTool         *tool,
                                                proximity, display);
 
   if (! gimp_color_tool_is_enabled (GIMP_COLOR_TOOL (tool))             &&
-      gimp_image_get_active_drawable (gimp_display_get_image (display)) &&
-      proximity)
+        drawable && proximity)
     {
       GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
       GimpBrushCore *brush_core = GIMP_BRUSH_CORE (paint_tool->core);
@@ -238,7 +238,7 @@ gimp_brush_tool_oper_update (GimpTool         *tool,
       if (GIMP_BRUSH_CORE_GET_CLASS (brush_core)->handles_transforming_brush)
         {
           gimp_brush_core_eval_transform_dynamics (paint_tool->core,
-                                                   NULL,
+                                                   drawable,
                                                    paint_options,
                                                    coords);
         }
@@ -368,6 +368,7 @@ gimp_brush_tool_brush_changed (GimpContext   *context,
 
   if (brush_core->main_brush != brush)
     gimp_brush_core_set_brush (brush_core, brush);
+
 }
 
 static void
@@ -386,7 +387,16 @@ gimp_brush_tool_set_brush (GimpBrushCore *brush_core,
                            GimpBrush     *brush,
                            GimpBrushTool *brush_tool)
 {
+  GimpPaintCore *paint_core = GIMP_PAINT_CORE (brush_core);
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (brush_tool));
+
+  if (GIMP_BRUSH_CORE_GET_CLASS (brush_core)->handles_transforming_brush)
+    {
+      gimp_brush_core_eval_transform_dynamics (paint_core,
+                                               NULL,
+                                               GIMP_PAINT_TOOL_GET_OPTIONS (brush_tool),
+                                               &paint_core->cur_coords);
+    }
 }
 
 static void



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