mirror of https://github.com/GNOME/gimp.git
app/paint-funcs/paint-funcs.[ch] app/core/gimpchannel.[ch]
2006-06-05 Sven Neumann <sven@gimp.org> * 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.
This commit is contained in:
parent
23f86e93b8
commit
528a5a3691
|
@ -1,3 +1,11 @@
|
|||
2006-06-05 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* 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 <edhel@gimp.org>
|
||||
|
||||
* app/tools/tools-enums.[ch]: added GimpRectangleGuide enum.
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue