[gimp/gimp-2-8] Bug 688746 - Select tool Alt+Shift and Alt+Ctrl dragging modifies...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] Bug 688746 - Select tool Alt+Shift and Alt+Ctrl dragging modifies...
- Date: Fri, 14 Dec 2012 22:06:11 +0000 (UTC)
commit 205c64d1b8ee9482a5c4eee9ff71c3ab53831805
Author: Michael Natterer <mitch gimp org>
Date: Fri Dec 14 23:02:56 2012 +0100
Bug 688746 - Select tool Alt+Shift and Alt+Ctrl dragging modifies...
Check for layer groups and locked layers in gimp_selection_tool_start_edit()
and show the usual warning instead of allowing the forbidden operation.
(cherry picked from commit 593ddb741f1479fddf25d708ae8d4411b9408f28)
app/tools/gimpselectiontool.c | 37 +++++++++++++++++++++++++++++--------
1 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/app/tools/gimpselectiontool.c b/app/tools/gimpselectiontool.c
index 438d733..d3111e0 100644
--- a/app/tools/gimpselectiontool.c
+++ b/app/tools/gimpselectiontool.c
@@ -416,15 +416,36 @@ gimp_selection_tool_start_edit (GimpSelectionTool *sel_tool,
return TRUE;
case SELECTION_MOVE:
- gimp_edit_selection_tool_start (tool, display, coords,
- GIMP_TRANSLATE_MODE_MASK_TO_LAYER, FALSE);
- return TRUE;
-
case SELECTION_MOVE_COPY:
- gimp_edit_selection_tool_start (tool, display, coords,
- GIMP_TRANSLATE_MODE_MASK_COPY_TO_LAYER,
- FALSE);
- return TRUE;
+ {
+ GimpImage *image = gimp_display_get_image (display);
+ GimpDrawable *drawable = gimp_image_get_active_drawable (image);
+
+ if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
+ {
+ gimp_tool_message_literal (tool, display,
+ _("Cannot modify the pixels of layer groups."));
+ }
+ else if (gimp_item_is_content_locked (GIMP_ITEM (drawable)))
+ {
+ gimp_tool_message_literal (tool, display,
+ _("The active layer's pixels are locked."));
+ }
+ else
+ {
+ GimpTranslateMode edit_mode;
+
+ if (sel_tool->function == SELECTION_MOVE)
+ edit_mode = GIMP_TRANSLATE_MODE_MASK_TO_LAYER;
+ else
+ edit_mode = GIMP_TRANSLATE_MODE_MASK_COPY_TO_LAYER;
+
+ gimp_edit_selection_tool_start (tool, display, coords,
+ edit_mode, FALSE);
+ }
+
+ return TRUE;
+ }
default:
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]