diff --git a/ChangeLog b/ChangeLog index 5a8085c4ee..5f5e797f47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-05 Sven Neumann + + * app/paint-funcs/paint-funcs.[ch] + * app/core/gimpchannel.[ch] + * app/core/gimpselection.c: + * app/actions/select-commands.c: further cleaned up the patch from + bug #88633. + 2006-06-05 Karine Delvare * app/tools/tools-enums.[ch]: added GimpRectangleGuide enum. diff --git a/app/actions/select-commands.c b/app/actions/select-commands.c index aa05a4d9a0..4e155f72cd 100644 --- a/app/actions/select-commands.c +++ b/app/actions/select-commands.c @@ -224,7 +224,7 @@ select_border_cmd_callback (GtkAction *action, { GimpDisplay *display; GtkWidget *dialog; - GtkWidget *feather_border; + GtkWidget *button; return_if_no_display (display, data); dialog = gimp_query_size_box (_("Border Selection"), @@ -240,15 +240,16 @@ select_border_cmd_callback (GtkAction *action, G_OBJECT (display->image), "disconnect", select_border_callback, display->image); - feather_border = gtk_check_button_new_with_mnemonic (_("_Feather border")); + button = gtk_check_button_new_with_mnemonic (_("_Feather border")); - gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), feather_border, + gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (dialog)), button, FALSE, FALSE, 0); - g_object_set_data (G_OBJECT (dialog), "border_feather_toggle", feather_border); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (feather_border), + g_object_set_data (G_OBJECT (dialog), "border-feather-toggle", button); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), select_border_feather); - gtk_widget_show (feather_border); + gtk_widget_show (button); gtk_widget_show (dialog); } @@ -345,9 +346,7 @@ select_feather_callback (GtkWidget *widget, gdouble radius_x; gdouble radius_y; - select_feather_radius = size; - - radius_x = radius_y = select_feather_radius; + radius_x = radius_y = select_feather_radius = size; if (unit != GIMP_UNIT_PIXEL) { @@ -372,17 +371,16 @@ select_border_callback (GtkWidget *widget, GimpUnit unit, gpointer data) { - GimpImage *image = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); + GtkWidget *button = g_object_get_data (G_OBJECT (widget), + "border-feather-toggle"); gdouble radius_x; gdouble radius_y; - select_border_radius = ROUND (size); - - radius_x = radius_y = select_border_radius; + radius_x = radius_y = select_border_radius = ROUND (size); select_border_feather = - GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (widget), - "border_feather_toggle"))->active; + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)); if (unit != GIMP_UNIT_PIXEL) { @@ -412,9 +410,7 @@ select_grow_callback (GtkWidget *widget, gdouble radius_x; gdouble radius_y; - select_grow_pixels = ROUND (size); - - radius_x = radius_y = select_grow_pixels; + radius_x = radius_y = select_grow_pixels = ROUND (size); if (unit != GIMP_UNIT_PIXEL) { @@ -443,9 +439,7 @@ select_shrink_callback (GtkWidget *widget, gint radius_x; gint radius_y; - select_shrink_pixels = ROUND (size); - - radius_x = radius_y = select_shrink_pixels; + radius_x = radius_y = select_shrink_pixels = ROUND (size); select_shrink_edge_lock = ! GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (widget), diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 9ddb104d43..48b636487b 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -193,7 +193,7 @@ static void gimp_channel_real_invert (GimpChannel *channel, static void gimp_channel_real_border (GimpChannel *channel, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo); static void gimp_channel_real_grow (GimpChannel *channel, gint radius_x, @@ -1285,7 +1285,7 @@ static void gimp_channel_real_border (GimpChannel *channel, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo) { PixelRegion bPR; @@ -1329,7 +1329,7 @@ gimp_channel_real_border (GimpChannel *channel, pixel_region_init (&bPR, GIMP_DRAWABLE (channel)->tiles, x1, y1, x2 - x1, y2 - y1, TRUE); - border_region (&bPR, radius_x, radius_y, feather_border); + border_region (&bPR, radius_x, radius_y, feather); channel->bounds_known = FALSE; @@ -1824,7 +1824,7 @@ void gimp_channel_border (GimpChannel *channel, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo) { g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -1832,8 +1832,9 @@ gimp_channel_border (GimpChannel *channel, if (! gimp_item_is_attached (GIMP_ITEM (channel))) push_undo = FALSE; - GIMP_CHANNEL_GET_CLASS (channel)->border (channel, radius_x, radius_y, - feather_border, push_undo); + GIMP_CHANNEL_GET_CLASS (channel)->border (channel, + radius_x, radius_y, feather, + push_undo); } void diff --git a/app/core/gimpchannel.h b/app/core/gimpchannel.h index 1eaa9f4cba..9f20a07234 100644 --- a/app/core/gimpchannel.h +++ b/app/core/gimpchannel.h @@ -92,7 +92,7 @@ struct _GimpChannelClass void (* border) (GimpChannel *channel, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo); void (* grow) (GimpChannel *channel, gint radius_x, @@ -193,7 +193,7 @@ void gimp_channel_invert (GimpChannel *mask, void gimp_channel_border (GimpChannel *mask, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo); void gimp_channel_grow (GimpChannel *mask, gint radius_x, diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c index c25fcc01e3..6cf90285b4 100644 --- a/app/core/gimpselection.c +++ b/app/core/gimpselection.c @@ -108,7 +108,7 @@ static void gimp_selection_invert (GimpChannel *channel, static void gimp_selection_border (GimpChannel *channel, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo); static void gimp_selection_grow (GimpChannel *channel, gint radius_x, @@ -460,11 +460,12 @@ static void gimp_selection_border (GimpChannel *channel, gint radius_x, gint radius_y, - gboolean feather_border, + gboolean feather, gboolean push_undo) { - GIMP_CHANNEL_CLASS (parent_class)->border (channel, radius_x, radius_y, - feather_border, push_undo); + GIMP_CHANNEL_CLASS (parent_class)->border (channel, + radius_x, radius_y, feather, + push_undo); } static void @@ -473,7 +474,8 @@ gimp_selection_grow (GimpChannel *channel, gint radius_y, gboolean push_undo) { - GIMP_CHANNEL_CLASS (parent_class)->grow (channel, radius_x, radius_y, + GIMP_CHANNEL_CLASS (parent_class)->grow (channel, + radius_x, radius_y, push_undo); } @@ -484,8 +486,9 @@ gimp_selection_shrink (GimpChannel *channel, gboolean edge_lock, gboolean push_undo) { - GIMP_CHANNEL_CLASS (parent_class)->shrink (channel, radius_x, radius_y, - edge_lock, push_undo); + GIMP_CHANNEL_CLASS (parent_class)->shrink (channel, + radius_x, radius_y, edge_lock, + push_undo); } static void diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index 7b376e503f..ce10b292bf 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -3670,7 +3670,7 @@ void border_region (PixelRegion *src, gint16 xradius, gint16 yradius, - gboolean feather_border) + gboolean feather) { /* This function has no bugs, but if you imagine some you can @@ -3799,7 +3799,7 @@ border_region (PixelRegion *src, if (dist < 1.0) { - if (feather_border) + if (feather) a = 255 * (1.0 - sqrt (dist)); else a = 255; diff --git a/app/paint-funcs/paint-funcs.h b/app/paint-funcs/paint-funcs.h index f02c1c777c..ef41d4cfa3 100644 --- a/app/paint-funcs/paint-funcs.h +++ b/app/paint-funcs/paint-funcs.h @@ -382,7 +382,7 @@ void gaussian_blur_region (PixelRegion *srcR, void border_region (PixelRegion *src, gint16 xradius, gint16 yradius, - gboolean feather_border); + gboolean feather); void subsample_region (PixelRegion *srcPR, PixelRegion *destPR,