[gimp] app: "Reset to default values" does not properly reset aspect ratio.



commit 129a0e4bcdf1934d1190b3263c41174ef4c346df
Author: Jehan <jehan girinstud io>
Date:   Thu May 4 04:38:44 2017 +0200

    app: "Reset to default values" does not properly reset aspect ratio.
    
    Generated brushes can have specific aspect ratio, hence resetting to
    fixed property defaults may be wrong. Therefore GimpPaintOptions needs
    to redefine the reset() method from GimpConfigInterface.
    Note: the specific "Reset aspect ratio to brush's native aspect ratio"
    button was alright. But the broader "Reset to default values" was not.

 app/paint/gimppaintoptions.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c
index 843fbc4..44ebb51 100644
--- a/app/paint/gimppaintoptions.c
+++ b/app/paint/gimppaintoptions.c
@@ -148,6 +148,7 @@ static GimpConfig * gimp_paint_options_duplicate         (GimpConfig   *config);
 static gboolean     gimp_paint_options_copy              (GimpConfig   *src,
                                                           GimpConfig   *dest,
                                                           GParamFlags   flags);
+static void         gimp_paint_options_reset             (GimpConfig   *config);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpPaintOptions, gimp_paint_options,
@@ -425,6 +426,7 @@ gimp_paint_options_config_iface_init (GimpConfigInterface *config_iface)
 
   config_iface->duplicate = gimp_paint_options_duplicate;
   config_iface->copy      = gimp_paint_options_copy;
+  config_iface->reset     = gimp_paint_options_reset;
 }
 
 static void
@@ -799,6 +801,18 @@ gimp_paint_options_copy (GimpConfig  *src,
   return parent_config_iface->copy (src, dest, flags);
 }
 
+static void
+gimp_paint_options_reset (GimpConfig *config)
+{
+  GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (config));
+
+  parent_config_iface->reset (config);
+
+  if (brush)
+    gimp_paint_options_set_default_brush_aspect_ratio (GIMP_PAINT_OPTIONS (config),
+                                                       brush);
+}
+
 GimpPaintOptions *
 gimp_paint_options_new (GimpPaintInfo *paint_info)
 {


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