"gegl:seamless-clone" operation's properties "max-refine-steps" changed…

… into "max-refine-scale". See GEGL commit 346139b.
It does not fix the Seamless Clone tool, but at least now the slider
has a meaning.
This commit is contained in:
Jehan 2015-07-12 15:48:16 +02:00
parent 46465b0c0a
commit 43e4256d56
3 changed files with 19 additions and 19 deletions

View file

@ -39,7 +39,7 @@
enum
{
PROP_0,
PROP_MAX_REFINE_STEPS,
PROP_MAX_REFINE_SCALE,
};
@ -67,10 +67,10 @@ gimp_seamless_clone_options_class_init (GimpSeamlessCloneOptionsClass *klass)
object_class->set_property = gimp_seamless_clone_options_set_property;
object_class->get_property = gimp_seamless_clone_options_get_property;
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MAX_REFINE_STEPS,
"max-refine-steps",
_("Maximal amount of refinement points to be used for the interpolation mesh"),
0, 100000, 2000,
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_MAX_REFINE_SCALE,
"max-refine-scale",
_("Maximal scale of refinement points to be used for the interpolation mesh"),
0, 50, 5,
GIMP_PARAM_STATIC_STRINGS);
}
@ -89,8 +89,8 @@ gimp_seamless_clone_options_set_property (GObject *object,
switch (property_id)
{
case PROP_MAX_REFINE_STEPS:
options->max_refine_steps = g_value_get_int (value);
case PROP_MAX_REFINE_SCALE:
options->max_refine_scale = g_value_get_int (value);
break;
default:
@ -109,8 +109,8 @@ gimp_seamless_clone_options_get_property (GObject *object,
switch (property_id)
{
case PROP_MAX_REFINE_STEPS:
g_value_set_int (value, options->max_refine_steps);
case PROP_MAX_REFINE_SCALE:
g_value_set_int (value, options->max_refine_scale);
break;
default:
@ -126,10 +126,10 @@ gimp_seamless_clone_options_gui (GimpToolOptions *tool_options)
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
GtkWidget *scale;
scale = gimp_prop_spin_scale_new (config, "max-refine-steps",
_("Refinement points"),
scale = gimp_prop_spin_scale_new (config, "max-refine-scale",
_("Refinement scale"),
1.0, 10.0, 0);
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 0.0, 100000.0);
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 0.0, 50.0);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
gtk_widget_show (scale);

View file

@ -39,7 +39,7 @@ struct _GimpSeamlessCloneOptions
{
GimpToolOptions parent_instance;
gint max_refine_steps;
gint max_refine_scale;
gboolean temp;
};

View file

@ -618,7 +618,7 @@ gimp_seamless_clone_tool_options_notify (GimpTool *tool,
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
if (! strcmp (pspec->name, "max-refine-steps"))
if (! strcmp (pspec->name, "max-refine-scale"))
{
if (gimp_seamless_clone_tool_render_node_update (sc))
{
@ -689,7 +689,7 @@ gimp_seamless_clone_tool_create_render_node (GimpSeamlessCloneTool *sc)
op = gegl_node_new_child (node,
"operation", "gegl:seamless-clone",
"max-refine-steps", options->max_refine_steps,
"max-refine-scale", options->max_refine_scale,
NULL);
overlay = gegl_node_new_child (node,
@ -723,7 +723,7 @@ gimp_seamless_clone_tool_create_render_node (GimpSeamlessCloneTool *sc)
static gboolean
gimp_seamless_clone_tool_render_node_update (GimpSeamlessCloneTool *sc)
{
static gint rendered__max_refine_steps = -1;
static gint rendered__max_refine_scale = -1;
static gint rendered_xoff = G_MAXINT;
static gint rendered_yoff = G_MAXINT;
@ -732,7 +732,7 @@ gimp_seamless_clone_tool_render_node_update (GimpSeamlessCloneTool *sc)
gint off_x, off_y;
/* All properties stay the same. No need to update. */
if (rendered__max_refine_steps == options->max_refine_steps &&
if (rendered__max_refine_scale == options->max_refine_scale &&
rendered_xoff == sc->xoff &&
rendered_yoff == sc->yoff)
return FALSE;
@ -742,10 +742,10 @@ gimp_seamless_clone_tool_render_node_update (GimpSeamlessCloneTool *sc)
gegl_node_set (sc->sc_node,
"xoff", (gint) sc->xoff - off_x,
"yoff", (gint) sc->yoff - off_y,
"max-refine-steps", (gint) options->max_refine_steps,
"max-refine-scale", (gint) options->max_refine_scale,
NULL);
rendered__max_refine_steps = options->max_refine_steps;
rendered__max_refine_scale = options->max_refine_scale;
rendered_xoff = sc->xoff;
rendered_yoff = sc->yoff;