[gimp] Revert "app: do not forbid merging down floating layers, instead anchor them."
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Revert "app: do not forbid merging down floating layers, instead anchor them."
- Date: Sun, 31 Dec 2017 12:57:18 +0000 (UTC)
commit d91487e6af004de6496f2c0aefb549cff902d15b
Author: Michael Natterer <mitch gimp org>
Date: Sun Dec 31 13:56:00 2017 +0100
Revert "app: do not forbid merging down floating layers, instead anchor them."
This reverts commit 40bc5307dcac2ad47f78a4caed0d564d5c21e836.
It's not *exactly* the same. The floating selection can belong to a
channel or layer mask. Also, this belongs into the GUI layer, not the
core.
app/core/gimpimage-merge.c | 26 ++++++++++----------------
1 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c
index a26724b..54c72e7 100644
--- a/app/core/gimpimage-merge.c
+++ b/app/core/gimpimage-merge.c
@@ -239,6 +239,13 @@ gimp_image_merge_down (GimpImage *image,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+ if (gimp_layer_is_floating_sel (current_layer))
+ {
+ g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
+ _("Cannot merge down a floating selection."));
+ return NULL;
+ }
+
for (list = gimp_item_get_container_iter (GIMP_ITEM (current_layer));
list;
list = g_list_next (list))
@@ -291,22 +298,9 @@ gimp_image_merge_down (GimpImage *image,
GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE,
C_("undo-type", "Merge Down"));
- if (gimp_layer_is_floating_sel (current_layer))
- {
- /* Merging down a floating selection is basically equivalent to
- * anchoring it.
- */
- floating_sel_anchor (current_layer);
- /* layer is already set to the right layer below the floating
- * selection, on which we anchored. This will be the return value.
- */
- }
- else
- {
- layer = gimp_image_merge_layers (image,
- gimp_item_get_container (GIMP_ITEM (current_layer)),
- merge_list, context, merge_type);
- }
+ layer = gimp_image_merge_layers (image,
+ gimp_item_get_container (GIMP_ITEM (current_layer)),
+ merge_list, context, merge_type);
g_slist_free (merge_list);
gimp_image_undo_group_end (image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]