[gimp] Bug 683462 - cropping with rectangular select tool leaves misaligned...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 683462 - cropping with rectangular select tool leaves misaligned...
- Date: Thu, 6 Sep 2012 21:59:31 +0000 (UTC)
commit e546f2b43bbe77901516c780428bda40f5af26ba
Author: Michael Natterer <mitch gimp org>
Date: Thu Sep 6 23:55:35 2012 +0200
Bug 683462 - cropping with rectangular select tool leaves misaligned...
Reset the tool on image changes again, but not if only the active
drawable changes, so keep bug #678890 closed:
Introduce new dirty flag GIMP_DIRTY_ACTIVE_DRAWABLE and set it on all
tools' dirty_mask except for rect select. Check the new flag when
reseting the active tool because of a drawable change.
app/core/core-enums.c | 2 ++
app/core/core-enums.h | 1 +
app/display/gimpdisplayshell-tool-events.c | 4 +++-
app/tools/gimpcagetool.c | 3 ++-
app/tools/gimpforegroundselecttool.c | 4 +++-
app/tools/gimpimagemaptool.c | 3 ++-
app/tools/gimpiscissorstool.c | 4 +++-
app/tools/gimprectangleselecttool.c | 1 +
app/tools/gimptransformtool.c | 3 ++-
9 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/app/core/core-enums.c b/app/core/core-enums.c
index 5f206a3..3dfbaac 100644
--- a/app/core/core-enums.c
+++ b/app/core/core-enums.c
@@ -1226,6 +1226,7 @@ gimp_dirty_mask_get_type (void)
{ GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", "drawable" },
{ GIMP_DIRTY_VECTORS, "GIMP_DIRTY_VECTORS", "vectors" },
{ GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", "selection" },
+ { GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", "active-drawable" },
{ GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", "all" },
{ 0, NULL, NULL }
};
@@ -1242,6 +1243,7 @@ gimp_dirty_mask_get_type (void)
{ GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", NULL },
{ GIMP_DIRTY_VECTORS, "GIMP_DIRTY_VECTORS", NULL },
{ GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", NULL },
+ { GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", NULL },
{ GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", NULL },
{ 0, NULL, NULL }
};
diff --git a/app/core/core-enums.h b/app/core/core-enums.h
index 00fcb9b..a7e6f6a 100644
--- a/app/core/core-enums.h
+++ b/app/core/core-enums.h
@@ -571,6 +571,7 @@ typedef enum /*< pdb-skip >*/
GIMP_DIRTY_DRAWABLE = 1 << 6,
GIMP_DIRTY_VECTORS = 1 << 7,
GIMP_DIRTY_SELECTION = 1 << 8,
+ GIMP_DIRTY_ACTIVE_DRAWABLE = 1 << 9,
GIMP_DIRTY_ALL = 0xffff
} GimpDirtyMask;
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index 6b8df80..d9d2176 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -1686,7 +1686,9 @@ gimp_display_shell_initialize_tool (GimpDisplayShell *shell,
}
else if ((active_tool->drawable !=
gimp_image_get_active_drawable (image)) &&
- ! gimp_tool_control_get_preserve (active_tool->control))
+ (! gimp_tool_control_get_preserve (active_tool->control) &&
+ (gimp_tool_control_get_dirty_mask (active_tool->control) &
+ GIMP_DIRTY_ACTIVE_DRAWABLE)))
{
/* create a new one, deleting the current */
gimp_context_tool_changed (gimp_get_user_context (gimp));
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index 28d4a40..3c31d5f 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -184,7 +184,8 @@ gimp_cage_tool_init (GimpCageTool *self)
GIMP_DIRTY_IMAGE |
GIMP_DIRTY_IMAGE_STRUCTURE |
GIMP_DIRTY_DRAWABLE |
- GIMP_DIRTY_SELECTION);
+ GIMP_DIRTY_SELECTION |
+ GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_PERSPECTIVE);
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index 6085a56..73cf5cd 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -185,7 +185,9 @@ gimp_foreground_select_tool_init (GimpForegroundSelectTool *fg_select)
gimp_tool_control_set_scroll_lock (tool->control, FALSE);
gimp_tool_control_set_preserve (tool->control, FALSE);
- gimp_tool_control_set_dirty_mask (tool->control, GIMP_DIRTY_IMAGE_SIZE);
+ gimp_tool_control_set_dirty_mask (tool->control,
+ GIMP_DIRTY_IMAGE_SIZE |
+ GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_PIXEL_CENTER);
gimp_tool_control_set_tool_cursor (tool->control,
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index cf31208..766e349 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -211,7 +211,8 @@ gimp_image_map_tool_init (GimpImageMapTool *image_map_tool)
GIMP_DIRTY_IMAGE |
GIMP_DIRTY_IMAGE_STRUCTURE |
GIMP_DIRTY_DRAWABLE |
- GIMP_DIRTY_SELECTION);
+ GIMP_DIRTY_SELECTION |
+ GIMP_DIRTY_ACTIVE_DRAWABLE);
image_map_tool->drawable = NULL;
image_map_tool->operation = NULL;
diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c
index bc9ebb8..bcf5338 100644
--- a/app/tools/gimpiscissorstool.c
+++ b/app/tools/gimpiscissorstool.c
@@ -340,7 +340,9 @@ gimp_iscissors_tool_init (GimpIscissorsTool *iscissors)
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_snap_to (tool->control, FALSE);
gimp_tool_control_set_preserve (tool->control, FALSE);
- gimp_tool_control_set_dirty_mask (tool->control, GIMP_DIRTY_IMAGE_SIZE);
+ gimp_tool_control_set_dirty_mask (tool->control,
+ GIMP_DIRTY_IMAGE_SIZE |
+ GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_ISCISSORS);
iscissors->op = ISCISSORS_OP_NONE;
diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c
index 446c7f9..1d3acb1 100644
--- a/app/tools/gimprectangleselecttool.c
+++ b/app/tools/gimprectangleselecttool.c
@@ -227,6 +227,7 @@ gimp_rectangle_select_tool_init (GimpRectangleSelectTool *rect_sel_tool)
GIMP_CURSOR_PRECISION_PIXEL_BORDER);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_RECT_SELECT);
+ gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_tool_control_set_dirty_mask (tool->control,
GIMP_DIRTY_IMAGE_SIZE |
GIMP_DIRTY_SELECTION);
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index 4ea0b08..e532044 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -215,7 +215,8 @@ gimp_transform_tool_init (GimpTransformTool *tr_tool)
gimp_tool_control_set_dirty_mask (tool->control,
GIMP_DIRTY_IMAGE_SIZE |
GIMP_DIRTY_DRAWABLE |
- GIMP_DIRTY_SELECTION);
+ GIMP_DIRTY_SELECTION |
+ GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]