[gimp] app: Fix stroking brush size to brush default



commit 6d6ab78d2ab9e4803c500d4f2ff6b58c776a0437
Author: Alexia Death <alexiadeath gmail com>
Date:   Sat Mar 19 23:26:34 2011 +0200

    app: Fix stroking brush size to brush default

 app/core/gimpstrokeoptions.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpstrokeoptions.c b/app/core/gimpstrokeoptions.c
index 6b5163a..a7da078 100644
--- a/app/core/gimpstrokeoptions.c
+++ b/app/core/gimpstrokeoptions.c
@@ -31,6 +31,7 @@
 #include "config/gimpcoreconfig.h"
 
 #include "gimp.h"
+#include "gimpbrush.h"
 #include "gimpcontext.h"
 #include "gimpdashpattern.h"
 #include "gimpmarshal.h"
@@ -559,8 +560,25 @@ gimp_stroke_options_prepare (GimpStrokeOptions *options,
 
         if (use_default_values)
           {
+            GimpBrush *brush;
+            gdouble    brush_size;
+            gint       height;
+            gint       width;
+
             paint_options = gimp_paint_options_new (paint_info);
 
+            brush = gimp_context_get_brush (context);
+
+            if (GIMP_IS_BRUSH(brush))
+              {
+                gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
+                brush_size = MAX (height, width);
+
+                g_object_set (paint_options,
+                              "brush-size", brush_size,
+                              NULL);
+              }
+
             /*  undefine the paint-relevant context properties and get them
              *  from the passed context
              */



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