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.
This commit is contained in:
Jehan 2017-05-04 04:38:44 +02:00
parent e83b136108
commit 129a0e4bcd
1 changed files with 14 additions and 0 deletions

View File

@ -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)
{