From d230b2289b6338d08762abdfed805d41cbc94003 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sat, 28 Aug 2004 21:16:42 +0000 Subject: [PATCH] fixed confusion about which mode to use when being run with last values 2004-08-28 Sven Neumann * plug-ins/common/vpropagate.c (run): fixed confusion about which mode to use when being run with last values (bug #151308). --- ChangeLog | 5 +++++ plug-ins/common/vpropagate.c | 32 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72adf1f466..1a944bfa3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-08-28 Sven Neumann + + * plug-ins/common/vpropagate.c (run): fixed confusion about which + mode to use when being run with last values (bug #151308). + 2004-08-28 Simon Budig * plug-ins/common/plugindetails.c: workaround to avoid a warning diff --git a/plug-ins/common/vpropagate.c b/plug-ins/common/vpropagate.c index bc7bc18236..f1104ba566 100644 --- a/plug-ins/common/vpropagate.c +++ b/plug-ins/common/vpropagate.c @@ -311,12 +311,14 @@ run (const gchar *name, (vpvals.propagating_channel & PROPAGATING_ALPHA) ? TRUE : FALSE; propagate_value = (vpvals.propagating_channel & PROPAGATING_VALUE) ? TRUE : FALSE; + { - int i; + gint i; for (i = 0; i < 4; i++) - direction_mask_vec[i] = (vpvals.direction_mask & (1 << i)) - ? TRUE : FALSE; + direction_mask_vec[i] = + (vpvals.direction_mask & (1 << i)) ? TRUE : FALSE; } + if (! vpropagate_dialog (gimp_drawable_type (drawable_id))) return; } @@ -329,9 +331,9 @@ run (const gchar *name, vpvals.lower_limit = 0; vpvals.upper_limit = 255; - if(strcmp(name, ERODE_PLUG_IN_NAME) == 0) + if (strcmp (name, ERODE_PLUG_IN_NAME) == 0) vpvals.propagate_mode = 0; - else if(strcmp(name, DILATE_PLUG_IN_NAME) == 0) + else if (strcmp (name, DILATE_PLUG_IN_NAME) == 0) vpvals.propagate_mode = 1; } break; @@ -355,26 +357,28 @@ run (const gchar *name, vpvals.lower_limit = 0; vpvals.upper_limit = 255; - if(strcmp(name, ERODE_PLUG_IN_NAME) == 0) + if (strcmp (name, ERODE_PLUG_IN_NAME) == 0) vpvals.propagate_mode = 0; - else if(strcmp(name, DILATE_PLUG_IN_NAME) == 0) + else if (strcmp (name, DILATE_PLUG_IN_NAME) == 0) vpvals.propagate_mode = 1; } break; case GIMP_RUN_WITH_LAST_VALS: - gimp_get_data (DEFAULT_PLUG_IN_NAME, &vpvals); + gimp_get_data (name, &vpvals); break; } status = value_propagate (drawable_id); - if (run_mode != GIMP_RUN_NONINTERACTIVE || - strcmp(name, DEFAULT_PLUG_IN_NAME) != 0) - gimp_displays_flush(); - if (run_mode == GIMP_RUN_INTERACTIVE && status == GIMP_PDB_SUCCESS - && strcmp(name, DEFAULT_PLUG_IN_NAME) == 0) - gimp_set_data (DEFAULT_PLUG_IN_NAME, &vpvals, sizeof (VPValueType)); + if (status == GIMP_PDB_SUCCESS) + { + if (run_mode != GIMP_RUN_NONINTERACTIVE) + gimp_displays_flush (); + + if (run_mode == GIMP_RUN_INTERACTIVE) + gimp_set_data (name, &vpvals, sizeof (VPValueType)); + } values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status;