Commit 93fdaa05 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 731279 - Tool Preset Editor not working correctly

This (doesn't quite) fix an obscure part of the tool preset bugs: when
changing the brush on a GimpPaintOptions instance, we might or might
not change the brush size, aspect etc. to the set brush's native
values, possibly overwriting the intended values from a tool preset.

Implement GimpConfig::copy() and copy the affected values again after
the entire object has been copied, so we actually use the value of
gimp_config_copy()'s "source" object.

This would fix that particular tool preset problem if there wasn't
another bug that is still unfixed, stay tuned...
parent 9b07df3a
......@@ -131,23 +131,26 @@ enum
};
static void gimp_paint_options_config_iface_init (GimpConfigInterface *config_iface);
static void gimp_paint_options_config_iface_init (GimpConfigInterface *config_iface);
static void gimp_paint_options_dispose (GObject *object);
static void gimp_paint_options_finalize (GObject *object);
static void gimp_paint_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_paint_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_paint_options_dispose (GObject *object);
static void gimp_paint_options_finalize (GObject *object);
static void gimp_paint_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_paint_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GimpConfig * gimp_paint_options_duplicate (GimpConfig *config);
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_brush_changed (GimpContext *context,
GimpBrush *brush);
static void gimp_paint_options_brush_changed (GimpContext *context,
GimpBrush *brush);
......@@ -376,6 +379,7 @@ gimp_paint_options_config_iface_init (GimpConfigInterface *config_iface)
parent_config_iface = g_type_default_interface_peek (GIMP_TYPE_CONFIG);
config_iface->duplicate = gimp_paint_options_duplicate;
config_iface->copy = gimp_paint_options_copy;
}
static void
......@@ -759,6 +763,33 @@ gimp_paint_options_duplicate (GimpConfig *config)
return GIMP_CONFIG (new_options);
}
static gboolean
gimp_paint_options_copy (GimpConfig *src,
GimpConfig *dest,
GParamFlags flags)
{
if (parent_config_iface->copy (src, dest, flags))
{
GimpPaintOptions *options = GIMP_PAINT_OPTIONS (src);
/* after copying, copy those properties again which might have
* changed by setting the brush on dest, see
* gimp_paint_options_brush_changed().
*/
g_object_set (dest,
"brush-size", options->brush_size,
"brush-aspect-ratio", options->brush_aspect_ratio,
"brush-angle", options->brush_angle,
"brush-spacing", options->brush_spacing,
"brush-hardness", options->brush_hardness,
NULL);
return TRUE;
}
return FALSE;
}
static void
gimp_paint_options_brush_changed (GimpContext *context,
GimpBrush *brush)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment