[gimp] app: fix applying paint tool presets when gobal brush/dynamics are used



commit 7f626b9877ab7246546fa3b31aef4b3866f1a4ad
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jun 8 21:34:43 2011 +0200

    app: fix applying paint tool presets when gobal brush/dynamics are used

 app/tools/tool_manager.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c
index bc7a101..e0a6b73 100644
--- a/app/tools/tool_manager.c
+++ b/app/tools/tool_manager.c
@@ -654,6 +654,25 @@ tool_manager_preset_changed (GimpContext     *user_context,
   gimp_context_copy_properties (GIMP_CONTEXT (preset->tool_options),
                                 user_context,
                                 gimp_tool_preset_get_prop_mask (preset));
+
+  if (GIMP_IS_PAINT_OPTIONS (preset->tool_options))
+    {
+      GimpCoreConfig  *config = user_context->gimp->config;
+      GimpToolOptions *src    = preset->tool_options;
+      GimpToolOptions *dest   = tool_manager->active_tool->tool_info->tool_options;
+
+      /* if connect_options() did overwrite the brush options and the
+       * preset contains a brush, use the brush options from the
+       * preset
+       */
+      if (config->global_brush && preset->use_brush)
+        gimp_paint_options_copy_brush_props (GIMP_PAINT_OPTIONS (src),
+                                             GIMP_PAINT_OPTIONS (dest));
+
+      if (config->global_dynamics && preset->use_dynamics)
+        gimp_paint_options_copy_dynamics_props (GIMP_PAINT_OPTIONS (src),
+                                                GIMP_PAINT_OPTIONS (dest));
+    }
 }
 
 static void



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