[gimp] app: implement GimpToolActiveModifiers in GimpTool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: implement GimpToolActiveModifiers in GimpTool
- Date: Sun, 29 Oct 2017 15:43:37 +0000 (UTC)
commit a5e1dd84fdbd4549982da8829d0c98e72cafa9fb
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 29 16:38:24 2017 +0100
app: implement GimpToolActiveModifiers in GimpTool
Change gimp_tool_set_active_modifier_state() to honor the new
GimpToolControlSetting. Explicitly set the mode to SEPARATE in
all tools that require modifier keys during a stroke.
And here comes the actual fix: change GimpTransformTool and
GimpToolTransformGrid to use SAME mode, and remove their
active_modifer_key() and hover_modifier() impls, so it makes no
difference whether a modifier is pressed before of after mouse button
press/release.
app/display/gimptooltransformgrid.c | 43 +++++-------
app/tools/gimpblendtool.c | 2 +
app/tools/gimpcroptool.c | 14 +++--
app/tools/gimpeditselectiontool.c | 5 ++
app/tools/gimpfreeselecttool.c | 15 +++--
app/tools/gimpmeasuretool.c | 2 +
app/tools/gimprectangleselecttool.c | 20 +++---
app/tools/gimptexttool.c | 2 +
app/tools/gimptool.c | 128 ++++++++++++++++++++++++++---------
app/tools/gimptransformtool.c | 104 ++++++++++------------------
10 files changed, 191 insertions(+), 144 deletions(-)
---
diff --git a/app/display/gimptooltransformgrid.c b/app/display/gimptooltransformgrid.c
index 546851d..d1f6d3b 100644
--- a/app/display/gimptooltransformgrid.c
+++ b/app/display/gimptooltransformgrid.c
@@ -111,6 +111,7 @@ struct _GimpToolTransformGridPrivate
gdouble curx; /* current x coord */
gdouble cury; /* current y coord */
+ gdouble button_down; /* is the mouse button pressed */
gdouble mousex; /* x coord where mouse was clicked */
gdouble mousey; /* y coord where mouse was clicked */
@@ -172,10 +173,6 @@ static void gimp_tool_transform_grid_hover (GimpToolWidget *
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity);
-static void gimp_tool_transform_grid_motion_modifier(GimpToolWidget *widget,
- GdkModifierType key,
- gboolean press,
- GdkModifierType state);
static void gimp_tool_transform_grid_hover_modifier (GimpToolWidget *widget,
GdkModifierType key,
gboolean press,
@@ -216,7 +213,6 @@ gimp_tool_transform_grid_class_init (GimpToolTransformGridClass *klass)
widget_class->button_release = gimp_tool_transform_grid_button_release;
widget_class->motion = gimp_tool_transform_grid_motion;
widget_class->hover = gimp_tool_transform_grid_hover;
- widget_class->motion_modifier = gimp_tool_transform_grid_motion_modifier;
widget_class->hover_modifier = gimp_tool_transform_grid_hover_modifier;
widget_class->get_cursor = gimp_tool_transform_grid_get_cursor;
@@ -1137,8 +1133,9 @@ gimp_tool_transform_grid_button_press (GimpToolWidget *widget,
GimpToolTransformGrid *grid = GIMP_TOOL_TRANSFORM_GRID (widget);
GimpToolTransformGridPrivate *private = grid->private;
- private->mousex = coords->x;
- private->mousey = coords->y;
+ private->button_down = TRUE;
+ private->mousex = coords->x;
+ private->mousey = coords->y;
if (private->handle != GIMP_TRANSFORM_HANDLE_NONE)
{
@@ -1202,6 +1199,10 @@ gimp_tool_transform_grid_button_release (GimpToolWidget *widget,
GdkModifierType state,
GimpButtonReleaseType release_type)
{
+ GimpToolTransformGrid *grid = GIMP_TOOL_TRANSFORM_GRID (widget);
+ GimpToolTransformGridPrivate *private = grid->private;
+
+ private->button_down = FALSE;
}
void
@@ -1945,10 +1946,10 @@ gimp_tool_transform_grid_modifier (GimpToolWidget *widget,
}
static void
-gimp_tool_transform_grid_motion_modifier (GimpToolWidget *widget,
- GdkModifierType key,
- gboolean press,
- GdkModifierType state)
+gimp_tool_transform_grid_hover_modifier (GimpToolWidget *widget,
+ GdkModifierType key,
+ gboolean press,
+ GdkModifierType state)
{
GimpToolTransformGrid *grid = GIMP_TOOL_TRANSFORM_GRID (widget);
GimpToolTransformGridPrivate *private = grid->private;
@@ -1956,19 +1957,13 @@ gimp_tool_transform_grid_motion_modifier (GimpToolWidget *widget,
gimp_tool_transform_grid_modifier (widget, key);
- /* send a non-motion to update the grid with the new constraints */
- coords.x = private->curx;
- coords.y = private->cury;
- gimp_tool_transform_grid_motion (widget, &coords, 0, state);
-}
-
-static void
-gimp_tool_transform_grid_hover_modifier (GimpToolWidget *widget,
- GdkModifierType key,
- gboolean press,
- GdkModifierType state)
-{
- gimp_tool_transform_grid_modifier (widget, key);
+ if (private->button_down)
+ {
+ /* send a non-motion to update the grid with the new constraints */
+ coords.x = private->curx;
+ coords.y = private->cury;
+ gimp_tool_transform_grid_motion (widget, &coords, 0, state);
+ }
}
static gboolean
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 89d5f24..b362342 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -198,6 +198,8 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_wants_double_click (tool->control, TRUE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
gimp_tool_control_set_tool_cursor (tool->control,
diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c
index 9b60a31..dd5ea3b 100644
--- a/app/tools/gimpcroptool.c
+++ b/app/tools/gimpcroptool.c
@@ -140,11 +140,15 @@ gimp_crop_tool_init (GimpCropTool *crop_tool)
{
GimpTool *tool = GIMP_TOOL (crop_tool);
- gimp_tool_control_set_wants_click (tool->control, TRUE);
- gimp_tool_control_set_precision (tool->control,
- GIMP_CURSOR_PRECISION_PIXEL_BORDER);
- gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_CROSSHAIR_SMALL);
- gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CROP);
+ gimp_tool_control_set_wants_click (tool->control, TRUE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
+ gimp_tool_control_set_precision (tool->control,
+ GIMP_CURSOR_PRECISION_PIXEL_BORDER);
+ gimp_tool_control_set_cursor (tool->control,
+ GIMP_CURSOR_CROSSHAIR_SMALL);
+ gimp_tool_control_set_tool_cursor (tool->control,
+ GIMP_TOOL_CURSOR_CROP);
gimp_draw_tool_set_default_status (GIMP_DRAW_TOOL (tool),
_("Click-Drag to draw a crop rectangle"));
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index 3289ed3..e50d10a 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -171,7 +171,12 @@ gimp_edit_selection_tool_class_init (GimpEditSelectionToolClass *klass)
static void
gimp_edit_selection_tool_init (GimpEditSelectionTool *edit_select)
{
+ GimpTool *tool = GIMP_TOOL (edit_select);
+
edit_select->first_move = TRUE;
+
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
}
static void
diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c
index 54bba55..f74f2ea 100644
--- a/app/tools/gimpfreeselecttool.c
+++ b/app/tools/gimpfreeselecttool.c
@@ -166,12 +166,15 @@ gimp_free_select_tool_init (GimpFreeSelectTool *fst)
GIMP_TYPE_FREE_SELECT_TOOL,
GimpFreeSelectToolPrivate);
- gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
- gimp_tool_control_set_wants_click (tool->control, TRUE);
- gimp_tool_control_set_precision (tool->control,
- GIMP_CURSOR_PRECISION_SUBPIXEL);
- gimp_tool_control_set_tool_cursor (tool->control,
- GIMP_TOOL_CURSOR_FREE_SELECT);
+ gimp_tool_control_set_motion_mode (tool->control,
+ GIMP_MOTION_MODE_EXACT);
+ gimp_tool_control_set_wants_click (tool->control, TRUE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
+ gimp_tool_control_set_precision (tool->control,
+ GIMP_CURSOR_PRECISION_SUBPIXEL);
+ gimp_tool_control_set_tool_cursor (tool->control,
+ GIMP_TOOL_CURSOR_FREE_SELECT);
}
static void
diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c
index 7b519f1..76d2240 100644
--- a/app/tools/gimpmeasuretool.c
+++ b/app/tools/gimpmeasuretool.c
@@ -143,6 +143,8 @@ gimp_measure_tool_init (GimpMeasureTool *measure)
GimpTool *tool = GIMP_TOOL (measure);
gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_PIXEL_BORDER);
gimp_tool_control_set_cursor (tool->control,
diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c
index 9077168..d23e33e 100644
--- a/app/tools/gimprectangleselecttool.c
+++ b/app/tools/gimprectangleselecttool.c
@@ -184,15 +184,17 @@ gimp_rectangle_select_tool_init (GimpRectangleSelectTool *rect_tool)
GIMP_TYPE_RECTANGLE_SELECT_TOOL,
GimpRectangleSelectToolPrivate);
- gimp_tool_control_set_wants_click (tool->control, TRUE);
- gimp_tool_control_set_precision (tool->control,
- 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);
+ gimp_tool_control_set_wants_click (tool->control, TRUE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
+ gimp_tool_control_set_precision (tool->control,
+ 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);
}
static void
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index 6eb7001..e3e579f 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -249,6 +249,8 @@ gimp_text_tool_init (GimpTextTool *text_tool)
gimp_tool_control_set_wants_double_click (tool->control, TRUE);
gimp_tool_control_set_wants_triple_click (tool->control, TRUE);
gimp_tool_control_set_wants_all_key_events (tool->control, TRUE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_PIXEL_BORDER);
gimp_tool_control_set_tool_cursor (tool->control,
diff --git a/app/tools/gimptool.c b/app/tools/gimptool.c
index 11080e0..ceed324 100644
--- a/app/tools/gimptool.c
+++ b/app/tools/gimptool.c
@@ -43,6 +43,9 @@
#include "gimp-intl.h"
+/* #define DEBUG_ACTIVE_STATE 1 */
+
+
enum
{
PROP_0,
@@ -1007,7 +1010,8 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
- gboolean press;
+ GimpToolActiveModifiers active_modifiers;
+ gboolean press;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
@@ -1018,6 +1022,8 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
g_return_if_fail (display == tool->focus_display);
+ active_modifiers = gimp_tool_control_get_active_modifiers (tool->control);
+
if (state_changed (tool->active_modifier_state, state, GDK_SHIFT_MASK,
&press))
{
@@ -1026,15 +1032,29 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
press ? "pressed" : "released");
#endif
- if (! press && (tool->button_press_state & GDK_SHIFT_MASK))
- {
- tool->button_press_state &= ~GDK_SHIFT_MASK;
- }
- else
+ switch (active_modifiers)
{
- gimp_tool_active_modifier_key (tool, GDK_SHIFT_MASK,
- press, state,
- display);
+ case GIMP_TOOL_ACTIVE_MODIFIERS_OFF:
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SAME:
+ gimp_tool_modifier_key (tool, GDK_SHIFT_MASK,
+ press, state,
+ display);
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE:
+ if (! press && (tool->button_press_state & GDK_SHIFT_MASK))
+ {
+ tool->button_press_state &= ~GDK_SHIFT_MASK;
+ }
+ else
+ {
+ gimp_tool_active_modifier_key (tool, GDK_SHIFT_MASK,
+ press, state,
+ display);
+ }
+ break;
}
}
@@ -1046,15 +1066,29 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
press ? "pressed" : "released");
#endif
- if (! press && (tool->button_press_state & GDK_CONTROL_MASK))
- {
- tool->button_press_state &= ~GDK_CONTROL_MASK;
- }
- else
+ switch (active_modifiers)
{
- gimp_tool_active_modifier_key (tool, GDK_CONTROL_MASK,
- press, state,
- display);
+ case GIMP_TOOL_ACTIVE_MODIFIERS_OFF:
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SAME:
+ gimp_tool_modifier_key (tool, GDK_CONTROL_MASK,
+ press, state,
+ display);
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE:
+ if (! press && (tool->button_press_state & GDK_CONTROL_MASK))
+ {
+ tool->button_press_state &= ~GDK_CONTROL_MASK;
+ }
+ else
+ {
+ gimp_tool_active_modifier_key (tool, GDK_CONTROL_MASK,
+ press, state,
+ display);
+ }
+ break;
}
}
@@ -1066,15 +1100,29 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
press ? "pressed" : "released");
#endif
- if (! press && (tool->button_press_state & GDK_MOD1_MASK))
- {
- tool->button_press_state &= ~GDK_MOD1_MASK;
- }
- else
+ switch (active_modifiers)
{
- gimp_tool_active_modifier_key (tool, GDK_MOD1_MASK,
- press, state,
- display);
+ case GIMP_TOOL_ACTIVE_MODIFIERS_OFF:
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SAME:
+ gimp_tool_modifier_key (tool, GDK_MOD1_MASK,
+ press, state,
+ display);
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE:
+ if (! press && (tool->button_press_state & GDK_MOD1_MASK))
+ {
+ tool->button_press_state &= ~GDK_MOD1_MASK;
+ }
+ else
+ {
+ gimp_tool_active_modifier_key (tool, GDK_MOD1_MASK,
+ press, state,
+ display);
+ }
+ break;
}
}
@@ -1086,15 +1134,29 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
press ? "pressed" : "released");
#endif
- if (! press && (tool->button_press_state & GDK_MOD2_MASK))
+ switch (active_modifiers)
{
- tool->button_press_state &= ~GDK_MOD2_MASK;
- }
- else
- {
- gimp_tool_active_modifier_key (tool, GDK_MOD2_MASK,
- press, state,
- display);
+ case GIMP_TOOL_ACTIVE_MODIFIERS_OFF:
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SAME:
+ gimp_tool_modifier_key (tool, GDK_MOD2_MASK,
+ press, state,
+ display);
+ break;
+
+ case GIMP_TOOL_ACTIVE_MODIFIERS_SEPARATE:
+ if (! press && (tool->button_press_state & GDK_MOD2_MASK))
+ {
+ tool->button_press_state &= ~GDK_MOD2_MASK;
+ }
+ else
+ {
+ gimp_tool_active_modifier_key (tool, GDK_MOD2_MASK,
+ press, state,
+ display);
+ }
+ break;
}
}
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index 34e74a2..71a5a17 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -91,11 +91,6 @@ static void gimp_transform_tool_modifier_key (GimpTool
gboolean press,
GdkModifierType state,
GimpDisplay *display);
-static void gimp_transform_tool_active_modifier_key (GimpTool *tool,
- GdkModifierType key,
- gboolean press,
- GdkModifierType state,
- GimpDisplay *display);
static void gimp_transform_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
@@ -181,7 +176,6 @@ gimp_transform_tool_class_init (GimpTransformToolClass *klass)
tool_class->button_release = gimp_transform_tool_button_release;
tool_class->motion = gimp_transform_tool_motion;
tool_class->modifier_key = gimp_transform_tool_modifier_key;
- tool_class->active_modifier_key = gimp_transform_tool_active_modifier_key;
tool_class->cursor_update = gimp_transform_tool_cursor_update;
tool_class->can_undo = gimp_transform_tool_can_undo;
tool_class->can_redo = gimp_transform_tool_can_redo;
@@ -206,20 +200,21 @@ gimp_transform_tool_init (GimpTransformTool *tr_tool)
{
GimpTool *tool = GIMP_TOOL (tr_tool);
- gimp_tool_control_set_action_opacity (tool->control,
- "tools/tools-transform-preview-opacity-set");
-
- gimp_tool_control_set_scroll_lock (tool->control, TRUE);
- gimp_tool_control_set_preserve (tool->control, FALSE);
- gimp_tool_control_set_dirty_mask (tool->control,
- GIMP_DIRTY_IMAGE_SIZE |
- GIMP_DIRTY_DRAWABLE |
- GIMP_DIRTY_SELECTION |
- GIMP_DIRTY_ACTIVE_DRAWABLE);
- gimp_tool_control_set_precision (tool->control,
- GIMP_CURSOR_PRECISION_SUBPIXEL);
- gimp_tool_control_set_cursor (tool->control,
- GIMP_CURSOR_CROSSHAIR_SMALL);
+ gimp_tool_control_set_scroll_lock (tool->control, TRUE);
+ gimp_tool_control_set_preserve (tool->control, FALSE);
+ gimp_tool_control_set_dirty_mask (tool->control,
+ GIMP_DIRTY_IMAGE_SIZE |
+ GIMP_DIRTY_DRAWABLE |
+ GIMP_DIRTY_SELECTION |
+ GIMP_DIRTY_ACTIVE_DRAWABLE);
+ gimp_tool_control_set_active_modifiers (tool->control,
+ GIMP_TOOL_ACTIVE_MODIFIERS_SAME);
+ gimp_tool_control_set_precision (tool->control,
+ GIMP_CURSOR_PRECISION_SUBPIXEL);
+ gimp_tool_control_set_cursor (tool->control,
+ GIMP_CURSOR_CROSSHAIR_SMALL);
+ gimp_tool_control_set_action_opacity (tool->control,
+ "tools/tools-transform-preview-opacity-set");
tr_tool->progress_text = _("Transforming");
@@ -445,33 +440,6 @@ gimp_transform_tool_motion (GimpTool *tool,
}
static void
-gimp_transform_tool_modifier (GimpTool *tool,
- GdkModifierType key)
-{
- GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tool);
-
- if (key == gimp_get_constrain_behavior_mask ())
- {
- g_object_set (options,
- "frompivot-scale", ! options->frompivot_scale,
- "frompivot-shear", ! options->frompivot_shear,
- "frompivot-perspective", ! options->frompivot_perspective,
- NULL);
- }
- else if (key == gimp_get_extend_selection_mask ())
- {
- g_object_set (options,
- "cornersnap", ! options->cornersnap,
- "constrain-move", ! options->constrain_move,
- "constrain-scale", ! options->constrain_scale,
- "constrain-rotate", ! options->constrain_rotate,
- "constrain-shear", ! options->constrain_shear,
- "constrain-perspective", ! options->constrain_perspective,
- NULL);
- }
-}
-
-static void
gimp_transform_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
@@ -480,6 +448,8 @@ gimp_transform_tool_modifier_key (GimpTool *tool,
{
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tool);
+ g_printerr ("modifier key\n");
+
if (tr_tool->widget)
{
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool, key, press,
@@ -487,27 +457,27 @@ gimp_transform_tool_modifier_key (GimpTool *tool,
}
else
{
- gimp_transform_tool_modifier (tool, key);
- }
-}
+ GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tool);
-static void
-gimp_transform_tool_active_modifier_key (GimpTool *tool,
- GdkModifierType key,
- gboolean press,
- GdkModifierType state,
- GimpDisplay *display)
-{
- GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tool);
-
- if (tr_tool->widget)
- {
- GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool, key, press,
- state, display);
- }
- else
- {
- gimp_transform_tool_modifier (tool, key);
+ if (key == gimp_get_constrain_behavior_mask ())
+ {
+ g_object_set (options,
+ "frompivot-scale", ! options->frompivot_scale,
+ "frompivot-shear", ! options->frompivot_shear,
+ "frompivot-perspective", ! options->frompivot_perspective,
+ NULL);
+ }
+ else if (key == gimp_get_extend_selection_mask ())
+ {
+ g_object_set (options,
+ "cornersnap", ! options->cornersnap,
+ "constrain-move", ! options->constrain_move,
+ "constrain-scale", ! options->constrain_scale,
+ "constrain-rotate", ! options->constrain_rotate,
+ "constrain-shear", ! options->constrain_shear,
+ "constrain-perspective", ! options->constrain_perspective,
+ NULL);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]