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
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2001-02-04 12:51:17 +08:00
|
|
|
#include <stdlib.h>
|
2008-05-23 22:09:55 +08:00
|
|
|
#include <string.h>
|
2001-02-04 12:51:17 +08:00
|
|
|
|
2012-03-20 02:57:55 +08:00
|
|
|
#include <gegl.h>
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2011-04-28 20:23:33 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
|
|
|
|
2003-09-16 01:41:18 +08:00
|
|
|
#include "core/gimp-transform-utils.h"
|
2001-04-25 02:43:31 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2014-05-25 21:44:38 +08:00
|
|
|
#include "widgets/gimpspinscale.h"
|
2003-08-22 09:42:57 +08:00
|
|
|
|
2013-06-07 17:52:48 +08:00
|
|
|
#include "display/gimptoolgui.h"
|
|
|
|
|
2001-04-25 02:43:31 +08:00
|
|
|
#include "gimpsheartool.h"
|
2003-04-16 00:05:52 +08:00
|
|
|
#include "gimptoolcontrol.h"
|
2003-02-09 05:12:03 +08:00
|
|
|
#include "gimptransformoptions.h"
|
1998-01-22 15:02:57 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* index into trans_info array */
|
2011-03-28 06:50:46 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
HORZ_OR_VERT,
|
|
|
|
XSHEAR,
|
|
|
|
YSHEAR
|
|
|
|
};
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* the minimum movement before direction of shear can be determined (pixels) */
|
2000-01-05 19:18:38 +08:00
|
|
|
#define MIN_MOVE 5
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-03-31 21:36:34 +08:00
|
|
|
#define SB_WIDTH 10
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2004-08-06 21:56:34 +08:00
|
|
|
/* local function prototypes */
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2011-08-27 14:37:30 +08:00
|
|
|
static void gimp_shear_tool_dialog (GimpTransformTool *tr_tool);
|
|
|
|
static void gimp_shear_tool_dialog_update (GimpTransformTool *tr_tool);
|
2001-04-25 02:43:31 +08:00
|
|
|
|
2011-08-27 14:37:30 +08:00
|
|
|
static void gimp_shear_tool_prepare (GimpTransformTool *tr_tool);
|
|
|
|
static void gimp_shear_tool_motion (GimpTransformTool *tr_tool);
|
|
|
|
static void gimp_shear_tool_recalc_matrix (GimpTransformTool *tr_tool);
|
|
|
|
static gchar * gimp_shear_tool_get_undo_desc (GimpTransformTool *tr_tool);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2011-08-27 14:37:30 +08:00
|
|
|
static void shear_x_mag_changed (GtkAdjustment *adj,
|
|
|
|
GimpTransformTool *tr_tool);
|
|
|
|
static void shear_y_mag_changed (GtkAdjustment *adj,
|
|
|
|
GimpTransformTool *tr_tool);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
|
|
|
|
2006-05-15 17:46:31 +08:00
|
|
|
G_DEFINE_TYPE (GimpShearTool, gimp_shear_tool, GIMP_TYPE_TRANSFORM_TOOL)
|
1998-08-15 21:34:54 +08:00
|
|
|
|
2001-04-25 02:43:31 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_shear_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
2001-04-25 02:43:31 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_SHEAR_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_TRANSFORM_OPTIONS,
|
|
|
|
gimp_transform_options_gui,
|
2003-06-28 19:20:37 +08:00
|
|
|
0,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-shear-tool",
|
2002-11-01 07:06:09 +08:00
|
|
|
_("Shear"),
|
2006-10-17 17:38:51 +08:00
|
|
|
_("Shear Tool: Shear the layer, selection or path"),
|
2004-04-29 21:19:28 +08:00
|
|
|
N_("S_hear"), "<shift>S",
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_SHEAR,
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_SHEAR,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-04-25 02:43:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_shear_tool_class_init (GimpShearToolClass *klass)
|
|
|
|
{
|
2004-06-05 07:08:29 +08:00
|
|
|
GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
|
2001-04-25 02:43:31 +08:00
|
|
|
|
2004-08-07 00:27:13 +08:00
|
|
|
trans_class->dialog = gimp_shear_tool_dialog;
|
|
|
|
trans_class->dialog_update = gimp_shear_tool_dialog_update;
|
|
|
|
trans_class->prepare = gimp_shear_tool_prepare;
|
|
|
|
trans_class->motion = gimp_shear_tool_motion;
|
2011-03-28 05:12:11 +08:00
|
|
|
trans_class->recalc_matrix = gimp_shear_tool_recalc_matrix;
|
2011-08-27 14:37:30 +08:00
|
|
|
trans_class->get_undo_desc = gimp_shear_tool_get_undo_desc;
|
2001-04-25 02:43:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_shear_tool_init (GimpShearTool *shear_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-10-21 05:27:34 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (shear_tool);
|
|
|
|
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (shear_tool);
|
2001-04-29 04:14:32 +08:00
|
|
|
|
2004-06-05 07:08:29 +08:00
|
|
|
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_SHEAR);
|
2002-06-17 01:13:39 +08:00
|
|
|
|
2005-10-01 01:50:50 +08:00
|
|
|
tr_tool->progress_text = _("Shearing");
|
2006-06-20 16:22:39 +08:00
|
|
|
|
|
|
|
tr_tool->use_grid = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-11-14 19:54:57 +08:00
|
|
|
gimp_shear_tool_dialog (GimpTransformTool *tr_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-08-06 21:56:34 +08:00
|
|
|
GimpShearTool *shear = GIMP_SHEAR_TOOL (tr_tool);
|
2014-05-25 21:44:38 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *scale;
|
2006-03-31 21:36:34 +08:00
|
|
|
|
2014-05-25 21:44:38 +08:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (gimp_tool_gui_get_vbox (tr_tool->gui)), vbox,
|
2013-06-07 17:52:48 +08:00
|
|
|
FALSE, FALSE, 0);
|
2014-05-25 21:44:38 +08:00
|
|
|
gtk_widget_show (vbox);
|
2006-03-31 21:36:34 +08:00
|
|
|
|
2014-05-25 21:44:38 +08:00
|
|
|
shear->x_adj = (GtkAdjustment *)
|
|
|
|
gtk_adjustment_new (0, -65536, 65536, 1, 10, 0);
|
|
|
|
scale = gimp_spin_scale_new (shear->x_adj, _("Shear magnitude _X"), 0);
|
|
|
|
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), -1000, 1000);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2006-03-31 21:36:34 +08:00
|
|
|
|
|
|
|
g_signal_connect (shear->x_adj, "value-changed",
|
2006-04-12 20:49:29 +08:00
|
|
|
G_CALLBACK (shear_x_mag_changed),
|
2006-03-31 21:36:34 +08:00
|
|
|
tr_tool);
|
|
|
|
|
2014-05-25 21:44:38 +08:00
|
|
|
shear->y_adj = (GtkAdjustment *)
|
|
|
|
gtk_adjustment_new (0, -65536, 65536, 1, 10, 0);
|
|
|
|
scale = gimp_spin_scale_new (shear->y_adj, _("Shear magnitude _Y"), 0);
|
|
|
|
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), -1000, 1000);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2006-03-31 21:36:34 +08:00
|
|
|
|
|
|
|
g_signal_connect (shear->y_adj, "value-changed",
|
2006-04-12 20:49:29 +08:00
|
|
|
G_CALLBACK (shear_y_mag_changed),
|
2006-03-31 21:36:34 +08:00
|
|
|
tr_tool);
|
1998-08-15 21:34:54 +08:00
|
|
|
}
|
|
|
|
|
2004-08-07 00:27:13 +08:00
|
|
|
static void
|
|
|
|
gimp_shear_tool_dialog_update (GimpTransformTool *tr_tool)
|
|
|
|
{
|
|
|
|
GimpShearTool *shear = GIMP_SHEAR_TOOL (tr_tool);
|
|
|
|
|
2010-10-19 18:27:33 +08:00
|
|
|
gtk_adjustment_set_value (shear->x_adj, tr_tool->trans_info[XSHEAR]);
|
|
|
|
gtk_adjustment_set_value (shear->y_adj, tr_tool->trans_info[YSHEAR]);
|
2004-08-07 00:27:13 +08:00
|
|
|
}
|
|
|
|
|
1998-08-15 21:34:54 +08:00
|
|
|
static void
|
2011-03-28 04:39:31 +08:00
|
|
|
gimp_shear_tool_prepare (GimpTransformTool *tr_tool)
|
1998-08-15 21:34:54 +08:00
|
|
|
{
|
2003-02-08 01:12:21 +08:00
|
|
|
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_UNKNOWN;
|
2002-11-14 19:54:57 +08:00
|
|
|
tr_tool->trans_info[XSHEAR] = 0.0;
|
|
|
|
tr_tool->trans_info[YSHEAR] = 0.0;
|
1998-08-15 21:34:54 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static void
|
2011-03-28 04:39:31 +08:00
|
|
|
gimp_shear_tool_motion (GimpTransformTool *tr_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-06-20 16:22:39 +08:00
|
|
|
gdouble diffx = tr_tool->curx - tr_tool->lastx;
|
|
|
|
gdouble diffy = tr_tool->cury - tr_tool->lasty;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* If we haven't yet decided on which way to control shearing
|
|
|
|
* decide using the maximum differential
|
|
|
|
*/
|
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_UNKNOWN)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2016-02-13 05:48:59 +08:00
|
|
|
if (ABS (diffx) > MIN_MOVE || ABS (diffy) > MIN_MOVE)
|
2004-08-06 21:56:34 +08:00
|
|
|
{
|
2016-02-13 05:48:59 +08:00
|
|
|
if (ABS (diffx) > ABS (diffy))
|
2004-08-06 21:56:34 +08:00
|
|
|
{
|
|
|
|
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_HORIZONTAL;
|
|
|
|
tr_tool->trans_info[XSHEAR] = 0.0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_VERTICAL;
|
|
|
|
tr_tool->trans_info[XSHEAR] = 0.0;
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
/* set the current coords to the last ones */
|
|
|
|
else
|
2004-08-06 21:56:34 +08:00
|
|
|
{
|
|
|
|
tr_tool->curx = tr_tool->lastx;
|
|
|
|
tr_tool->cury = tr_tool->lasty;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* if the direction is known, keep track of the magnitude */
|
2006-06-20 16:22:39 +08:00
|
|
|
if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_HORIZONTAL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-06-20 16:22:39 +08:00
|
|
|
if (tr_tool->cury > (tr_tool->ty1 + tr_tool->ty3) / 2)
|
|
|
|
tr_tool->trans_info[XSHEAR] += diffx;
|
|
|
|
else
|
|
|
|
tr_tool->trans_info[XSHEAR] -= diffx;
|
|
|
|
}
|
|
|
|
else if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_VERTICAL)
|
|
|
|
{
|
|
|
|
if (tr_tool->curx > (tr_tool->tx1 + tr_tool->tx2) / 2)
|
|
|
|
tr_tool->trans_info[YSHEAR] += diffy;
|
|
|
|
else
|
|
|
|
tr_tool->trans_info[YSHEAR] -= diffy;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-01-05 19:18:38 +08:00
|
|
|
static void
|
2011-03-28 05:12:11 +08:00
|
|
|
gimp_shear_tool_recalc_matrix (GimpTransformTool *tr_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-11-20 02:23:43 +08:00
|
|
|
gdouble amount;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-08-06 21:56:34 +08:00
|
|
|
if (tr_tool->trans_info[XSHEAR] == 0.0 &&
|
|
|
|
tr_tool->trans_info[YSHEAR] == 0.0)
|
2006-06-20 16:22:39 +08:00
|
|
|
{
|
|
|
|
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_UNKNOWN;
|
|
|
|
}
|
2004-08-06 21:56:34 +08:00
|
|
|
|
2003-02-08 01:12:21 +08:00
|
|
|
if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_HORIZONTAL)
|
2002-11-14 19:54:57 +08:00
|
|
|
amount = tr_tool->trans_info[XSHEAR];
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2002-11-14 19:54:57 +08:00
|
|
|
amount = tr_tool->trans_info[YSHEAR];
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-03-22 03:10:11 +08:00
|
|
|
gimp_matrix3_identity (&tr_tool->transform);
|
|
|
|
gimp_transform_matrix_shear (&tr_tool->transform,
|
|
|
|
tr_tool->x1,
|
2003-09-16 01:41:18 +08:00
|
|
|
tr_tool->y1,
|
app/core/gimp-transform-utils.[ch]. switch from x1,y1,x2,y2 bounding boxes
2004-10-27 Michael Natterer <mitch@gimp.org>
* app/core/gimp-transform-utils.[ch]. switch from x1,y1,x2,y2
bounding boxes to x,y,width,height ones. Added
gimp_transform_matrix_flip_free(). Renamed some parameters to be
consistent with others. Some internal cleanup.
* app/tools/gimpperspectivetool.c
* app/tools/gimpscaletool.c
* app/tools/gimpsheartool.c
* tools/pdbgen/pdb/drawable_transform.pdb
* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.
* tools/pdbgen/pdb/drawable_transform.pdb
* tools/pdbgen/pdb/transform_tools.pdb: guard all transform
wrappers with if(gimp_drawable_mask_intersect(...)), also the
ones which don't need the returned bounding box.
* tools/pdbgen/pdb/drawable_transform.pdb: renamed some parameters
and added gimp_drawable_transform_matrix() which takes the 9
coefficients of a 3x3 matrix for ultimate flexibility ;)
* app/pdb/drawable_transform_cmds.c
* app/pdb/internal_procs.c
* app/pdb/transform_tools_cmds.c
* libgimp/gimpdrawabletransform_pdb.[ch]: regenerated.
2004-10-28 01:56:02 +08:00
|
|
|
tr_tool->x2 - tr_tool->x1,
|
|
|
|
tr_tool->y2 - tr_tool->y1,
|
2003-09-16 01:41:18 +08:00
|
|
|
tr_tool->trans_info[HORZ_OR_VERT],
|
2005-03-22 03:10:11 +08:00
|
|
|
amount);
|
2002-11-14 19:54:57 +08:00
|
|
|
}
|
|
|
|
|
2011-08-27 14:37:30 +08:00
|
|
|
static gchar *
|
|
|
|
gimp_shear_tool_get_undo_desc (GimpTransformTool *tr_tool)
|
|
|
|
{
|
|
|
|
gdouble x = tr_tool->trans_info[XSHEAR];
|
|
|
|
gdouble y = tr_tool->trans_info[YSHEAR];
|
|
|
|
|
|
|
|
switch ((gint) tr_tool->trans_info[HORZ_OR_VERT])
|
|
|
|
{
|
|
|
|
case GIMP_ORIENTATION_HORIZONTAL:
|
|
|
|
return g_strdup_printf (C_("undo-type", "Shear horizontally by %-3.3g"),
|
|
|
|
x);
|
|
|
|
|
|
|
|
case GIMP_ORIENTATION_VERTICAL:
|
|
|
|
return g_strdup_printf (C_("undo-type", "Shear vertically by %-3.3g"),
|
|
|
|
y);
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* e.g. user entered numbers but no notification callback */
|
|
|
|
return g_strdup_printf (C_("undo-type", "Shear horizontally by %-3.3g, vertically by %-3.3g"),
|
|
|
|
x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-14 19:54:57 +08:00
|
|
|
static void
|
2006-03-31 21:36:34 +08:00
|
|
|
shear_x_mag_changed (GtkAdjustment *adj,
|
2002-11-18 21:10:04 +08:00
|
|
|
GimpTransformTool *tr_tool)
|
2002-11-14 19:54:57 +08:00
|
|
|
{
|
2006-03-31 21:36:34 +08:00
|
|
|
gdouble value = gtk_adjustment_get_value (adj);
|
2002-11-14 19:54:57 +08:00
|
|
|
|
|
|
|
if (value != tr_tool->trans_info[XSHEAR])
|
|
|
|
{
|
2002-11-18 21:10:04 +08:00
|
|
|
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
|
2002-11-14 19:54:57 +08:00
|
|
|
|
2004-08-06 21:56:34 +08:00
|
|
|
if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_UNKNOWN)
|
|
|
|
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_HORIZONTAL;
|
|
|
|
|
2002-11-14 19:54:57 +08:00
|
|
|
tr_tool->trans_info[XSHEAR] = value;
|
|
|
|
|
2011-08-13 23:42:41 +08:00
|
|
|
gimp_transform_tool_push_internal_undo (tr_tool);
|
|
|
|
|
2011-03-28 05:12:11 +08:00
|
|
|
gimp_transform_tool_recalc_matrix (tr_tool);
|
2004-08-07 00:27:13 +08:00
|
|
|
|
2002-11-18 21:10:04 +08:00
|
|
|
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
|
2002-11-14 19:54:57 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-03-31 21:36:34 +08:00
|
|
|
shear_y_mag_changed (GtkAdjustment *adj,
|
2002-11-18 21:10:04 +08:00
|
|
|
GimpTransformTool *tr_tool)
|
2002-11-14 19:54:57 +08:00
|
|
|
{
|
2006-03-31 21:36:34 +08:00
|
|
|
gdouble value = gtk_adjustment_get_value (adj);
|
2002-11-14 19:54:57 +08:00
|
|
|
|
|
|
|
if (value != tr_tool->trans_info[YSHEAR])
|
|
|
|
{
|
2002-11-18 21:10:04 +08:00
|
|
|
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
|
2002-11-14 19:54:57 +08:00
|
|
|
|
2004-08-06 21:56:34 +08:00
|
|
|
if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_UNKNOWN)
|
|
|
|
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_VERTICAL;
|
|
|
|
|
2002-11-14 19:54:57 +08:00
|
|
|
tr_tool->trans_info[YSHEAR] = value;
|
|
|
|
|
2011-08-13 23:42:41 +08:00
|
|
|
gimp_transform_tool_push_internal_undo (tr_tool);
|
|
|
|
|
2011-03-28 05:12:11 +08:00
|
|
|
gimp_transform_tool_recalc_matrix (tr_tool);
|
2004-08-07 00:27:13 +08:00
|
|
|
|
2002-11-18 21:10:04 +08:00
|
|
|
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
|
2002-11-14 19:54:57 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|