2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
2000-01-26 07:06:12 +08:00
|
|
|
|
2013-10-15 07:58:39 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2008-11-10 01:15:00 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2002-02-22 06:19:45 +08:00
|
|
|
#include "core-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2012-03-19 21:22:41 +08:00
|
|
|
#include "gimpboundary.h"
|
2013-04-12 22:58:18 +08:00
|
|
|
#include "gimpdrawable-filter.h"
|
2008-11-12 18:56:06 +08:00
|
|
|
#include "gimperror.h"
|
2002-02-22 06:19:45 +08:00
|
|
|
#include "gimpimage.h"
|
2003-02-13 19:23:50 +08:00
|
|
|
#include "gimpimage-undo.h"
|
2003-02-14 22:14:29 +08:00
|
|
|
#include "gimpimage-undo-push.h"
|
2002-02-22 06:19:45 +08:00
|
|
|
#include "gimplayer.h"
|
|
|
|
#include "gimplayer-floating-sel.h"
|
|
|
|
#include "gimplayermask.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
|
|
|
|
2008-11-10 01:15:00 +08:00
|
|
|
/* public functions */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2001-01-29 07:25:25 +08:00
|
|
|
floating_sel_attach (GimpLayer *layer,
|
2006-04-12 20:49:29 +08:00
|
|
|
GimpDrawable *drawable)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2001-01-29 07:25:25 +08:00
|
|
|
GimpLayer *floating_sel;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-01-26 23:34:47 +08:00
|
|
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
|
|
|
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
2004-01-27 00:18:16 +08:00
|
|
|
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
|
2004-01-26 23:34:47 +08:00
|
|
|
g_return_if_fail (drawable != GIMP_DRAWABLE (layer));
|
|
|
|
g_return_if_fail (gimp_item_get_image (GIMP_ITEM (layer)) ==
|
|
|
|
gimp_item_get_image (GIMP_ITEM (drawable)));
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
image = gimp_item_get_image (GIMP_ITEM (drawable));
|
2004-01-26 23:34:47 +08:00
|
|
|
|
2008-11-14 23:01:44 +08:00
|
|
|
floating_sel = gimp_image_get_floating_selection (image);
|
2004-03-23 17:40:16 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* If there is already a floating selection, anchor it */
|
2004-03-23 17:40:16 +08:00
|
|
|
if (floating_sel)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-03-23 17:40:16 +08:00
|
|
|
floating_sel_anchor (floating_sel);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-07-14 03:25:34 +08:00
|
|
|
/* if we were pasting to the old floating selection, paste now
|
|
|
|
* to the drawable
|
|
|
|
*/
|
2004-03-23 05:23:12 +08:00
|
|
|
if (drawable == (GimpDrawable *) floating_sel)
|
2007-07-19 22:59:51 +08:00
|
|
|
drawable = gimp_image_get_active_drawable (image);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2007-05-28 07:07:36 +08:00
|
|
|
gimp_layer_set_lock_alpha (layer, TRUE, FALSE);
|
2008-11-17 08:02:15 +08:00
|
|
|
|
|
|
|
gimp_layer_set_floating_sel_drawable (layer, drawable);
|
2003-12-09 23:37:46 +08:00
|
|
|
|
2009-08-04 01:21:51 +08:00
|
|
|
gimp_image_add_layer (image, layer, NULL, 0, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-01-29 07:25:25 +08:00
|
|
|
floating_sel_anchor (GimpLayer *layer)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2013-04-12 22:58:18 +08:00
|
|
|
GimpImage *image;
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
GimpFilter *filter = NULL;
|
|
|
|
gint off_x, off_y;
|
|
|
|
gint dr_off_x, dr_off_y;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-01-26 23:34:47 +08:00
|
|
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
|
|
|
g_return_if_fail (gimp_layer_is_floating_sel (layer));
|
|
|
|
|
2013-08-11 01:43:12 +08:00
|
|
|
/* Don't let gimp_image_remove_layer free the layer while we still need it */
|
|
|
|
g_object_ref (layer);
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
image = gimp_item_get_image (GIMP_ITEM (layer));
|
2001-07-14 03:25:34 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_ANCHOR,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Anchor Floating Selection"));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2013-04-12 22:58:18 +08:00
|
|
|
drawable = gimp_layer_get_floating_sel_drawable (layer);
|
|
|
|
|
|
|
|
gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y);
|
|
|
|
gimp_item_get_offset (GIMP_ITEM (drawable), &dr_off_x, &dr_off_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2013-04-12 22:58:18 +08:00
|
|
|
if (gimp_item_get_visible (GIMP_ITEM (layer)) &&
|
|
|
|
gimp_rectangle_intersect (off_x, off_y,
|
|
|
|
gimp_item_get_width (GIMP_ITEM (layer)),
|
|
|
|
gimp_item_get_height (GIMP_ITEM (layer)),
|
|
|
|
dr_off_x, dr_off_y,
|
|
|
|
gimp_item_get_width (GIMP_ITEM (drawable)),
|
|
|
|
gimp_item_get_height (GIMP_ITEM (drawable)),
|
|
|
|
NULL, NULL, NULL, NULL))
|
|
|
|
{
|
|
|
|
filter = gimp_drawable_get_floating_sel_filter (drawable);
|
|
|
|
g_object_ref (filter);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* first remove the filter, then merge it, or we will get warnings
|
|
|
|
* about already connected nodes
|
|
|
|
*/
|
2008-10-10 03:40:41 +08:00
|
|
|
gimp_image_remove_layer (image, layer, TRUE, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2013-04-12 22:58:18 +08:00
|
|
|
if (filter)
|
|
|
|
{
|
2014-06-30 07:06:04 +08:00
|
|
|
gimp_drawable_merge_filter (drawable, filter, NULL, NULL, FALSE);
|
2013-04-12 22:58:18 +08:00
|
|
|
g_object_unref (filter);
|
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_end (image);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* invalidate the boundaries */
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimp_image_get_mask (image)));
|
2013-08-11 01:43:12 +08:00
|
|
|
|
|
|
|
g_object_unref (layer);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2007-12-07 02:00:10 +08:00
|
|
|
gboolean
|
|
|
|
floating_sel_to_layer (GimpLayer *layer,
|
|
|
|
GError **error)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-05-08 22:06:03 +08:00
|
|
|
GimpItem *item;
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2007-12-07 02:00:10 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
|
|
|
|
g_return_val_if_fail (gimp_layer_is_floating_sel (layer), FALSE);
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
2003-05-08 22:06:03 +08:00
|
|
|
|
2007-12-07 02:00:10 +08:00
|
|
|
item = GIMP_ITEM (layer);
|
|
|
|
image = gimp_item_get_image (item);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2009-09-02 01:23:44 +08:00
|
|
|
/* Check if the floating layer belongs to a channel */
|
2009-01-27 06:47:16 +08:00
|
|
|
if (GIMP_IS_CHANNEL (gimp_layer_get_floating_sel_drawable (layer)))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-11-12 18:56:06 +08:00
|
|
|
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
2008-11-04 20:33:09 +08:00
|
|
|
_("Cannot create a new layer from the floating "
|
|
|
|
"selection because it belongs to a layer mask "
|
|
|
|
"or channel."));
|
2007-12-09 22:19:02 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_TO_LAYER,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Floating Selection to Layer"));
|
2004-09-25 02:06:49 +08:00
|
|
|
|
2007-02-01 05:54:17 +08:00
|
|
|
gimp_image_undo_push_fs_to_layer (image, NULL, layer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2011-09-24 01:31:50 +08:00
|
|
|
gimp_drawable_detach_floating_sel (gimp_layer_get_floating_sel_drawable (layer));
|
2008-11-17 08:02:15 +08:00
|
|
|
gimp_layer_set_floating_sel_drawable (layer, NULL);
|
2007-05-28 07:07:36 +08:00
|
|
|
|
2007-12-24 00:58:41 +08:00
|
|
|
gimp_item_set_visible (item, TRUE, TRUE);
|
2007-05-28 07:07:36 +08:00
|
|
|
gimp_layer_set_lock_alpha (layer, FALSE, TRUE);
|
Made drawable/layer properties (visibility, opacity etc.) undoable (fixes
2003-03-17 Michael Natterer <mitch@gimp.org>
Made drawable/layer properties (visibility, opacity etc.)
undoable (fixes bug #73893).
* app/core/core-enums.[ch]: added undo types/groups for
visibility, mode, opacity, linked and preserve_trans.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpitemundo.[ch]: new GimpUndo subclass which holds a
ref'ed GimpItem pointer so (1) this doesn't need to be done by all
undo steps related to an item and (2) the item the undo step is
for can be determined from outside the undo system.
* app/core/gimpimage-undo.[ch]: added gimp_image_undo_push_item()
which returns a new GimpItemUndo.
* app/core/gimpimage-undo-push.[ch]: use it for all item related
undo steps. Removed lots of GimpItem, GimpLayer, GimpDrawable
and GimpVectors pointers from the private undo structs. Added
undo push functions for the new undo types added above.
* app/core/gimpdrawable.[ch] (gimp_drawable_set_visible): added
"gboolean push_undo" parameter.
* app/core/gimplayer.[ch] (gimp_layer_set_opacity, _mode,
_preserve_trans, _linked): added "gboolean push_undo" parameters.
* app/core/gimpimage-mask.c
* app/core/gimpimage-merge.c
* app/core/gimplayer-floating-sel.c
* app/tools/gimpmovetool.c
* app/xcf/xcf-load.c
* app/widgets/gimpdrawablelistitem.c
* app/widgets/gimplayerlistitem.c
* app/widgets/gimplayerlistview.c: changed accordingly.
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/layer.pdb: ditto. Added '$undo' paramaters to
the foo_accessors() functions. Removed $func from foo_accesors()
because we don't manipulate items without using getters/setters
any longer.
* app/pdb/channel_cmds.c
* app/pdb/layer_cmds.c: regenerated.
* app/widgets/gimpcellrenderertoggle.[ch]: added "clicked" signal
which carries an additional "GdkModifierType state" parameter as
in GimpCellRendererViewable .
* app/widgets/gimpcontainertreeview.c: emit "clicked" from
the toggle renderer, not "toggled" so the callbacks get the
modifier state.
* app/widgets/gimpdrawabletreeview.c: resurrected the "exclusive
visible by <shift>+click" feature as in 1.2.
* app/widgets/gimplayertreeview.c: compress layer opacity undos by
looking at the top of the undo stack and not pushing an undo if
there already is a GIMP_UNDO_DRAWABLE_OPACITY for the active
layer.
2003-03-18 02:02:41 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_end (image);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2009-08-29 18:11:28 +08:00
|
|
|
/* When the floating selection is converted to/from a normal layer
|
2009-08-29 18:13:28 +08:00
|
|
|
* it does something resembling a name change, so emit the
|
|
|
|
* "name-changed" signal
|
2009-08-29 18:11:28 +08:00
|
|
|
*/
|
2004-09-22 20:46:35 +08:00
|
|
|
gimp_object_name_changed (GIMP_OBJECT (layer));
|
|
|
|
|
2001-07-08 06:49:01 +08:00
|
|
|
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
2006-04-12 20:49:29 +08:00
|
|
|
0, 0,
|
2008-11-03 08:09:01 +08:00
|
|
|
gimp_item_get_width (item),
|
|
|
|
gimp_item_get_height (item));
|
2003-08-30 22:25:05 +08:00
|
|
|
|
2007-12-12 21:45:59 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2008-11-10 02:45:16 +08:00
|
|
|
void
|
|
|
|
floating_sel_activate_drawable (GimpLayer *layer)
|
|
|
|
{
|
2009-01-27 06:47:16 +08:00
|
|
|
GimpImage *image;
|
|
|
|
GimpDrawable *drawable;
|
2008-11-10 02:45:16 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
|
|
|
g_return_if_fail (gimp_layer_is_floating_sel (layer));
|
|
|
|
|
|
|
|
image = gimp_item_get_image (GIMP_ITEM (layer));
|
|
|
|
|
2009-01-27 06:47:16 +08:00
|
|
|
drawable = gimp_layer_get_floating_sel_drawable (layer);
|
|
|
|
|
2008-11-10 02:45:16 +08:00
|
|
|
/* set the underlying drawable to active */
|
2009-01-27 06:47:16 +08:00
|
|
|
if (GIMP_IS_LAYER_MASK (drawable))
|
2008-11-10 02:45:16 +08:00
|
|
|
{
|
2009-01-27 06:47:16 +08:00
|
|
|
GimpLayerMask *mask = GIMP_LAYER_MASK (drawable);
|
2008-11-10 02:45:16 +08:00
|
|
|
|
|
|
|
gimp_image_set_active_layer (image, gimp_layer_mask_get_layer (mask));
|
|
|
|
}
|
2009-01-27 06:47:16 +08:00
|
|
|
else if (GIMP_IS_CHANNEL (drawable))
|
2008-11-10 02:45:16 +08:00
|
|
|
{
|
2009-01-27 06:47:16 +08:00
|
|
|
gimp_image_set_active_channel (image, GIMP_CHANNEL (drawable));
|
2008-11-10 02:45:16 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-01-27 06:47:16 +08:00
|
|
|
gimp_image_set_active_layer (image, GIMP_LAYER (drawable));
|
2008-11-10 02:45:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-19 22:04:20 +08:00
|
|
|
const GimpBoundSeg *
|
2001-01-29 07:25:25 +08:00
|
|
|
floating_sel_boundary (GimpLayer *layer,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint *n_segs)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-01-26 23:34:47 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
|
|
|
|
g_return_val_if_fail (gimp_layer_is_floating_sel (layer), NULL);
|
|
|
|
g_return_val_if_fail (n_segs != NULL, NULL);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (layer->fs.boundary_known == FALSE)
|
|
|
|
{
|
2005-09-09 03:38:58 +08:00
|
|
|
gint width, height;
|
|
|
|
gint off_x, off_y;
|
|
|
|
|
2008-11-03 08:09:01 +08:00
|
|
|
width = gimp_item_get_width (GIMP_ITEM (layer));
|
|
|
|
height = gimp_item_get_height (GIMP_ITEM (layer));
|
2008-11-03 07:03:29 +08:00
|
|
|
gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y);
|
2005-09-09 03:38:58 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (layer->fs.segs)
|
2006-04-12 20:49:29 +08:00
|
|
|
g_free (layer->fs.segs);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-09-09 03:38:58 +08:00
|
|
|
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
|
|
|
|
{
|
2012-03-21 02:55:23 +08:00
|
|
|
GeglBuffer *buffer;
|
|
|
|
gint i;
|
|
|
|
|
2005-09-09 03:38:58 +08:00
|
|
|
/* find the segments */
|
2012-03-21 07:42:44 +08:00
|
|
|
buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
|
2012-03-21 02:55:23 +08:00
|
|
|
|
|
|
|
layer->fs.segs = gimp_boundary_find (buffer, NULL,
|
2012-04-22 02:10:45 +08:00
|
|
|
babl_format ("A float"),
|
2012-03-21 02:55:23 +08:00
|
|
|
GIMP_BOUNDARY_WITHIN_BOUNDS,
|
2012-03-19 22:04:20 +08:00
|
|
|
0, 0, width, height,
|
|
|
|
GIMP_BOUNDARY_HALF_WAY,
|
|
|
|
&layer->fs.num_segs);
|
2005-09-09 03:38:58 +08:00
|
|
|
|
|
|
|
/* offset the segments */
|
|
|
|
for (i = 0; i < layer->fs.num_segs; i++)
|
|
|
|
{
|
|
|
|
layer->fs.segs[i].x1 += off_x;
|
|
|
|
layer->fs.segs[i].y1 += off_y;
|
|
|
|
layer->fs.segs[i].x2 += off_x;
|
|
|
|
layer->fs.segs[i].y2 += off_y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
layer->fs.num_segs = 4;
|
2012-03-19 22:04:20 +08:00
|
|
|
layer->fs.segs = g_new0 (GimpBoundSeg, 4);
|
2005-09-09 03:38:58 +08:00
|
|
|
|
|
|
|
/* top */
|
|
|
|
layer->fs.segs[0].x1 = off_x;
|
|
|
|
layer->fs.segs[0].y1 = off_y;
|
|
|
|
layer->fs.segs[0].x2 = off_x + width;
|
|
|
|
layer->fs.segs[0].y2 = off_y;
|
|
|
|
|
|
|
|
/* left */
|
|
|
|
layer->fs.segs[1].x1 = off_x;
|
|
|
|
layer->fs.segs[1].y1 = off_y;
|
|
|
|
layer->fs.segs[1].x2 = off_x;
|
|
|
|
layer->fs.segs[1].y2 = off_y + height;
|
|
|
|
|
|
|
|
/* right */
|
|
|
|
layer->fs.segs[2].x1 = off_x + width;
|
|
|
|
layer->fs.segs[2].y1 = off_y;
|
|
|
|
layer->fs.segs[2].x2 = off_x + width;
|
|
|
|
layer->fs.segs[2].y2 = off_y + height;
|
|
|
|
|
|
|
|
/* bottom */
|
|
|
|
layer->fs.segs[3].x1 = off_x;
|
|
|
|
layer->fs.segs[3].y1 = off_y + height;
|
|
|
|
layer->fs.segs[3].x2 = off_x + width;
|
|
|
|
layer->fs.segs[3].y2 = off_y + height;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
layer->fs.boundary_known = TRUE;
|
|
|
|
}
|
|
|
|
|
2001-01-29 21:51:23 +08:00
|
|
|
*n_segs = layer->fs.num_segs;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return layer->fs.segs;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-01-29 07:25:25 +08:00
|
|
|
floating_sel_invalidate (GimpLayer *layer)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-01-26 23:34:47 +08:00
|
|
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
|
|
|
g_return_if_fail (gimp_layer_is_floating_sel (layer));
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Invalidate the attached-to drawable's preview */
|
2009-01-27 06:47:16 +08:00
|
|
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimp_layer_get_floating_sel_drawable (layer)));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Invalidate the boundary */
|
|
|
|
layer->fs.boundary_known = FALSE;
|
|
|
|
}
|