transformtool: Add temporary new handles
put perspective handles on the outside instead (if you invert the frame, they'll switch place with the scale handles, oh well)
This commit is contained in:
@ -89,6 +89,8 @@ gimp_handle_type_get_type (void)
|
|||||||
{ GIMP_HANDLE_FILLED_SQUARE, "GIMP_HANDLE_FILLED_SQUARE", "filled-square" },
|
{ GIMP_HANDLE_FILLED_SQUARE, "GIMP_HANDLE_FILLED_SQUARE", "filled-square" },
|
||||||
{ GIMP_HANDLE_CIRCLE, "GIMP_HANDLE_CIRCLE", "circle" },
|
{ GIMP_HANDLE_CIRCLE, "GIMP_HANDLE_CIRCLE", "circle" },
|
||||||
{ GIMP_HANDLE_FILLED_CIRCLE, "GIMP_HANDLE_FILLED_CIRCLE", "filled-circle" },
|
{ GIMP_HANDLE_FILLED_CIRCLE, "GIMP_HANDLE_FILLED_CIRCLE", "filled-circle" },
|
||||||
|
{ GIMP_HANDLE_DIAMOND, "GIMP_HANDLE_DIAMOND", "diamond" },
|
||||||
|
{ GIMP_HANDLE_FILLED_DIAMOND, "GIMP_HANDLE_FILLED_DIAMOND", "filled-diamond" },
|
||||||
{ GIMP_HANDLE_CROSS, "GIMP_HANDLE_CROSS", "cross" },
|
{ GIMP_HANDLE_CROSS, "GIMP_HANDLE_CROSS", "cross" },
|
||||||
{ 0, NULL, NULL }
|
{ 0, NULL, NULL }
|
||||||
};
|
};
|
||||||
@ -99,6 +101,8 @@ gimp_handle_type_get_type (void)
|
|||||||
{ GIMP_HANDLE_FILLED_SQUARE, "GIMP_HANDLE_FILLED_SQUARE", NULL },
|
{ GIMP_HANDLE_FILLED_SQUARE, "GIMP_HANDLE_FILLED_SQUARE", NULL },
|
||||||
{ GIMP_HANDLE_CIRCLE, "GIMP_HANDLE_CIRCLE", NULL },
|
{ GIMP_HANDLE_CIRCLE, "GIMP_HANDLE_CIRCLE", NULL },
|
||||||
{ GIMP_HANDLE_FILLED_CIRCLE, "GIMP_HANDLE_FILLED_CIRCLE", NULL },
|
{ GIMP_HANDLE_FILLED_CIRCLE, "GIMP_HANDLE_FILLED_CIRCLE", NULL },
|
||||||
|
{ GIMP_HANDLE_DIAMOND, "GIMP_HANDLE_DIAMOND", NULL },
|
||||||
|
{ GIMP_HANDLE_FILLED_DIAMOND, "GIMP_HANDLE_FILLED_DIAMOND", NULL },
|
||||||
{ GIMP_HANDLE_CROSS, "GIMP_HANDLE_CROSS", NULL },
|
{ GIMP_HANDLE_CROSS, "GIMP_HANDLE_CROSS", NULL },
|
||||||
{ 0, NULL, NULL }
|
{ 0, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -58,6 +58,8 @@ typedef enum
|
|||||||
GIMP_HANDLE_FILLED_SQUARE,
|
GIMP_HANDLE_FILLED_SQUARE,
|
||||||
GIMP_HANDLE_CIRCLE,
|
GIMP_HANDLE_CIRCLE,
|
||||||
GIMP_HANDLE_FILLED_CIRCLE,
|
GIMP_HANDLE_FILLED_CIRCLE,
|
||||||
|
GIMP_HANDLE_DIAMOND,
|
||||||
|
GIMP_HANDLE_FILLED_DIAMOND,
|
||||||
GIMP_HANDLE_CROSS
|
GIMP_HANDLE_CROSS
|
||||||
} GimpHandleType;
|
} GimpHandleType;
|
||||||
|
|
||||||
|
@ -277,6 +277,8 @@ gimp_canvas_handle_transform (GimpCanvasItem *item,
|
|||||||
case GIMP_HANDLE_CIRCLE:
|
case GIMP_HANDLE_CIRCLE:
|
||||||
case GIMP_HANDLE_FILLED_CIRCLE:
|
case GIMP_HANDLE_FILLED_CIRCLE:
|
||||||
case GIMP_HANDLE_CROSS:
|
case GIMP_HANDLE_CROSS:
|
||||||
|
case GIMP_HANDLE_DIAMOND:
|
||||||
|
case GIMP_HANDLE_FILLED_DIAMOND:
|
||||||
gimp_canvas_item_shift_to_center (private->anchor,
|
gimp_canvas_item_shift_to_center (private->anchor,
|
||||||
*x, *y,
|
*x, *y,
|
||||||
private->width,
|
private->width,
|
||||||
@ -344,6 +346,20 @@ gimp_canvas_handle_draw (GimpCanvasItem *item,
|
|||||||
_gimp_canvas_item_stroke (item, cr);
|
_gimp_canvas_item_stroke (item, cr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GIMP_HANDLE_DIAMOND:
|
||||||
|
case GIMP_HANDLE_FILLED_DIAMOND:
|
||||||
|
cairo_move_to (cr, x, y - (gdouble) private->height / 2.0);
|
||||||
|
cairo_line_to (cr, x + (gdouble) private->width / 2.0, y);
|
||||||
|
cairo_line_to (cr, x, y + (gdouble) private->height / 2.0);
|
||||||
|
cairo_line_to (cr, x - (gdouble) private->width / 2.0, y);
|
||||||
|
cairo_line_to (cr, x, y - (gdouble) private->height / 2.0);
|
||||||
|
|
||||||
|
if (private->type == GIMP_HANDLE_DIAMOND)
|
||||||
|
_gimp_canvas_item_stroke (item, cr);
|
||||||
|
else
|
||||||
|
_gimp_canvas_item_fill (item, cr);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -372,10 +388,12 @@ gimp_canvas_handle_get_extents (GimpCanvasItem *item,
|
|||||||
case GIMP_HANDLE_CIRCLE:
|
case GIMP_HANDLE_CIRCLE:
|
||||||
case GIMP_HANDLE_FILLED_CIRCLE:
|
case GIMP_HANDLE_FILLED_CIRCLE:
|
||||||
case GIMP_HANDLE_CROSS:
|
case GIMP_HANDLE_CROSS:
|
||||||
rectangle.x = x - private->width / 2 - 1.5;
|
case GIMP_HANDLE_DIAMOND:
|
||||||
rectangle.y = y - private->height / 2 - 1.5;
|
case GIMP_HANDLE_FILLED_DIAMOND:
|
||||||
rectangle.width = private->width + 3.0;
|
rectangle.x = x - private->width / 2 - 2.0;
|
||||||
rectangle.height = private->height + 3.0;
|
rectangle.y = y - private->height / 2 - 2.0;
|
||||||
|
rectangle.width = private->width + 4.0;
|
||||||
|
rectangle.height = private->height + 4.0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -422,6 +440,11 @@ gimp_canvas_handle_hit (GimpCanvasItem *item,
|
|||||||
return ((SQR (handle_tx - tx) + SQR (handle_ty - ty)) < SQR (width));
|
return ((SQR (handle_tx - tx) + SQR (handle_ty - ty)) < SQR (width));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case GIMP_HANDLE_DIAMOND:
|
||||||
|
case GIMP_HANDLE_FILLED_DIAMOND:
|
||||||
|
return ((ABS (handle_tx - tx) + ABS (handle_ty - ty)) < ABS (private->width));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
#include "gimpdrawtool.h"
|
#include "gimpdrawtool.h"
|
||||||
|
|
||||||
|
|
||||||
#define TRANS_INFO_SIZE 10
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
TRANSFORM_CREATING,
|
TRANSFORM_CREATING,
|
||||||
@ -37,9 +35,25 @@ typedef enum
|
|||||||
TRANSFORM_HANDLE_E, /* east */
|
TRANSFORM_HANDLE_E, /* east */
|
||||||
TRANSFORM_HANDLE_W, /* west */
|
TRANSFORM_HANDLE_W, /* west */
|
||||||
TRANSFORM_HANDLE_PIVOT, /* pivot for rotation and scaling */
|
TRANSFORM_HANDLE_PIVOT, /* pivot for rotation and scaling */
|
||||||
TRANSFORM_HANDLE_CENTER /* for moving */
|
TRANSFORM_HANDLE_CENTER, /* for moving */
|
||||||
|
/* extra handles for unified tool */
|
||||||
|
TRANSFORM_HANDLE_NW_P, /* perspective handles */
|
||||||
|
TRANSFORM_HANDLE_NE_P,
|
||||||
|
TRANSFORM_HANDLE_SW_P,
|
||||||
|
TRANSFORM_HANDLE_SE_P,
|
||||||
|
TRANSFORM_HANDLE_N_S, /* shearing handles */
|
||||||
|
TRANSFORM_HANDLE_S_S,
|
||||||
|
TRANSFORM_HANDLE_E_S,
|
||||||
|
TRANSFORM_HANDLE_W_S,
|
||||||
|
TRANSFORM_HANDLE_ROTATION, /* rotation handle */
|
||||||
|
|
||||||
|
TRANSFORM_HANDLE_NUM /* keep this last so *handles[] is the right size */
|
||||||
} TransformAction;
|
} TransformAction;
|
||||||
|
|
||||||
|
/* This is not the number of items in the enum above, but the max size of the
|
||||||
|
* enums at the top of each transformation tool, stored in trans_info and related */
|
||||||
|
#define TRANS_INFO_SIZE 10
|
||||||
|
|
||||||
typedef gdouble TransInfo[TRANS_INFO_SIZE];
|
typedef gdouble TransInfo[TRANS_INFO_SIZE];
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +88,7 @@ struct _GimpTransformTool
|
|||||||
gint x1, y1; /* upper left hand coordinate */
|
gint x1, y1; /* upper left hand coordinate */
|
||||||
gint x2, y2; /* lower right hand coords */
|
gint x2, y2; /* lower right hand coords */
|
||||||
gdouble cx, cy; /* center point (for moving) */
|
gdouble cx, cy; /* center point (for moving) */
|
||||||
gdouble px, py; /* pivot point (for rotation) */
|
gdouble px, py; /* pivot point (for rotation/scaling)*/
|
||||||
gdouble aspect; /* original aspect ratio */
|
gdouble aspect; /* original aspect ratio */
|
||||||
|
|
||||||
gdouble tx1, ty1; /* transformed handle coords */
|
gdouble tx1, ty1; /* transformed handle coords */
|
||||||
@ -102,7 +116,7 @@ struct _GimpTransformTool
|
|||||||
gboolean use_mid_handles; /* use handles at midpoints of edges */
|
gboolean use_mid_handles; /* use handles at midpoints of edges */
|
||||||
gboolean use_pivot; /* use pivot point */
|
gboolean use_pivot; /* use pivot point */
|
||||||
|
|
||||||
GimpCanvasItem *handles[TRANSFORM_HANDLE_CENTER + 1];
|
GimpCanvasItem *handles[TRANSFORM_HANDLE_NUM];
|
||||||
|
|
||||||
const gchar *progress_text;
|
const gchar *progress_text;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ gimp_unified_transform_tool_register (GimpToolRegisterCallback callback,
|
|||||||
_("Unified Transform"),
|
_("Unified Transform"),
|
||||||
_("Unified Transform Tool: "
|
_("Unified Transform Tool: "
|
||||||
"Transform the layer, selection or path"),
|
"Transform the layer, selection or path"),
|
||||||
N_("_Unified Transform"), "<shift>U",
|
N_("_Unified Transform"), "<shift>L",
|
||||||
NULL, GIMP_HELP_TOOL_UNIFIED_TRANSFORM,
|
NULL, GIMP_HELP_TOOL_UNIFIED_TRANSFORM,
|
||||||
GIMP_STOCK_TOOL_UNIFIED_TRANSFORM,
|
GIMP_STOCK_TOOL_UNIFIED_TRANSFORM,
|
||||||
data);
|
data);
|
||||||
@ -179,9 +179,10 @@ gimp_unified_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||||||
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (draw_tool);
|
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (draw_tool);
|
||||||
GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tool);
|
GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tool);
|
||||||
GimpImage *image = gimp_display_get_image (tool->display);
|
GimpImage *image = gimp_display_get_image (tool->display);
|
||||||
gint handle_w;
|
GimpCanvasGroup *stroke_group;
|
||||||
gint handle_h;
|
gint handle_w, handle_h;
|
||||||
gint i;
|
gint i, d;
|
||||||
|
gdouble x, y;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (tr_tool->handles); i++)
|
for (i = 0; i < G_N_ELEMENTS (tr_tool->handles); i++)
|
||||||
tr_tool->handles[i] = NULL;
|
tr_tool->handles[i] = NULL;
|
||||||
@ -214,41 +215,65 @@ gimp_unified_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||||||
gimp_transform_tool_handles_recalc (tr_tool, tool->display,
|
gimp_transform_tool_handles_recalc (tr_tool, tool->display,
|
||||||
&handle_w, &handle_h);
|
&handle_w, &handle_h);
|
||||||
|
|
||||||
if (tr_tool->use_handles)
|
/* draw the scale handles */
|
||||||
{
|
|
||||||
/* draw the tool handles */
|
|
||||||
tr_tool->handles[TRANSFORM_HANDLE_NW] =
|
tr_tool->handles[TRANSFORM_HANDLE_NW] =
|
||||||
gimp_draw_tool_add_handle (draw_tool,
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
GIMP_HANDLE_SQUARE,
|
GIMP_HANDLE_SQUARE,
|
||||||
tr_tool->tx1, tr_tool->ty1,
|
tr_tool->tx1, tr_tool->ty1,
|
||||||
handle_w, handle_h,
|
handle_w, handle_h,
|
||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_NORTH_WEST);
|
||||||
|
|
||||||
tr_tool->handles[TRANSFORM_HANDLE_NE] =
|
tr_tool->handles[TRANSFORM_HANDLE_NE] =
|
||||||
gimp_draw_tool_add_handle (draw_tool,
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
GIMP_HANDLE_SQUARE,
|
GIMP_HANDLE_SQUARE,
|
||||||
tr_tool->tx2, tr_tool->ty2,
|
tr_tool->tx2, tr_tool->ty2,
|
||||||
handle_w, handle_h,
|
handle_w, handle_h,
|
||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_NORTH_EAST);
|
||||||
|
|
||||||
tr_tool->handles[TRANSFORM_HANDLE_SW] =
|
tr_tool->handles[TRANSFORM_HANDLE_SW] =
|
||||||
gimp_draw_tool_add_handle (draw_tool,
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
GIMP_HANDLE_SQUARE,
|
GIMP_HANDLE_SQUARE,
|
||||||
tr_tool->tx3, tr_tool->ty3,
|
tr_tool->tx3, tr_tool->ty3,
|
||||||
handle_w, handle_h,
|
handle_w, handle_h,
|
||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_SOUTH_WEST);
|
||||||
|
|
||||||
tr_tool->handles[TRANSFORM_HANDLE_SE] =
|
tr_tool->handles[TRANSFORM_HANDLE_SE] =
|
||||||
gimp_draw_tool_add_handle (draw_tool,
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
GIMP_HANDLE_SQUARE,
|
GIMP_HANDLE_SQUARE,
|
||||||
tr_tool->tx4, tr_tool->ty4,
|
tr_tool->tx4, tr_tool->ty4,
|
||||||
handle_w, handle_h,
|
handle_w, handle_h,
|
||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_SOUTH_EAST);
|
||||||
|
|
||||||
if (tr_tool->use_mid_handles)
|
/* draw the perspective handles */
|
||||||
{
|
tr_tool->handles[TRANSFORM_HANDLE_NW_P] =
|
||||||
gdouble x, y;
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_SQUARE,
|
||||||
|
tr_tool->tx1, tr_tool->ty1,
|
||||||
|
handle_w/4*3, handle_h/4*3,
|
||||||
|
GIMP_HANDLE_ANCHOR_SOUTH_EAST);
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_NE_P] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_SQUARE,
|
||||||
|
tr_tool->tx2, tr_tool->ty2,
|
||||||
|
handle_w/4*3, handle_h/4*3,
|
||||||
|
GIMP_HANDLE_ANCHOR_SOUTH_WEST);
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_SW_P] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_SQUARE,
|
||||||
|
tr_tool->tx3, tr_tool->ty3,
|
||||||
|
handle_w/4*3, handle_h/4*3,
|
||||||
|
GIMP_HANDLE_ANCHOR_NORTH_EAST);
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_SE_P] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_SQUARE,
|
||||||
|
tr_tool->tx4, tr_tool->ty4,
|
||||||
|
handle_w/4*3, handle_h/4*3,
|
||||||
|
GIMP_HANDLE_ANCHOR_NORTH_WEST);
|
||||||
|
|
||||||
|
/* draw the side handles */
|
||||||
x = (tr_tool->tx1 + tr_tool->tx2) / 2.0;
|
x = (tr_tool->tx1 + tr_tool->tx2) / 2.0;
|
||||||
y = (tr_tool->ty1 + tr_tool->ty2) / 2.0;
|
y = (tr_tool->ty1 + tr_tool->ty2) / 2.0;
|
||||||
|
|
||||||
@ -288,13 +313,63 @@ gimp_unified_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||||||
x, y,
|
x, y,
|
||||||
handle_w, handle_h,
|
handle_w, handle_h,
|
||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tr_tool->use_pivot)
|
/* draw the shear handles */
|
||||||
{
|
x = (tr_tool->tx1 * 2 + tr_tool->tx2 * 3) / 5;
|
||||||
GimpCanvasGroup *stroke_group;
|
y = (tr_tool->ty1 * 2 + tr_tool->ty2 * 3) / 5;
|
||||||
gint d = MIN (handle_w, handle_h) * 2; /* so you can grab it from under the center handle */
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_N_S] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_FILLED_DIAMOND,
|
||||||
|
x, y,
|
||||||
|
handle_w, handle_h,
|
||||||
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
|
x = (tr_tool->tx2 * 2 + tr_tool->tx4 * 3) / 5;
|
||||||
|
y = (tr_tool->ty2 * 2 + tr_tool->ty4 * 3) / 5;
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_E_S] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_FILLED_DIAMOND,
|
||||||
|
x, y,
|
||||||
|
handle_w, handle_h,
|
||||||
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
|
x = (tr_tool->tx3 * 3 + tr_tool->tx4 * 2) / 5;
|
||||||
|
y = (tr_tool->ty3 * 3 + tr_tool->ty4 * 2) / 5;
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_S_S] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_FILLED_DIAMOND,
|
||||||
|
x, y,
|
||||||
|
handle_w, handle_h,
|
||||||
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
|
x = (tr_tool->tx3 * 3 + tr_tool->tx1 * 2) / 5;
|
||||||
|
y = (tr_tool->ty3 * 3 + tr_tool->ty1 * 2) / 5;
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_W_S] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_FILLED_DIAMOND,
|
||||||
|
x, y,
|
||||||
|
handle_w, handle_h,
|
||||||
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
|
|
||||||
|
/* draw the rotation handle */
|
||||||
|
x = (tr_tool->tx1 * 3 + tr_tool->tx2 * 2) / 5;
|
||||||
|
y = (tr_tool->ty1 * 3 + tr_tool->ty2 * 2) / 5;
|
||||||
|
|
||||||
|
tr_tool->handles[TRANSFORM_HANDLE_ROTATION] =
|
||||||
|
gimp_draw_tool_add_handle (draw_tool,
|
||||||
|
GIMP_HANDLE_FILLED_CIRCLE,
|
||||||
|
x, y,
|
||||||
|
handle_w, handle_h,
|
||||||
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
|
|
||||||
|
/* draw the rotation center axis handle */
|
||||||
|
d = MIN (handle_w, handle_h) * 2; /* so you can grab it from under the center handle */
|
||||||
|
|
||||||
stroke_group = gimp_draw_tool_add_stroke_group (draw_tool);
|
stroke_group = gimp_draw_tool_add_stroke_group (draw_tool);
|
||||||
|
|
||||||
@ -314,13 +389,9 @@ gimp_unified_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
gimp_draw_tool_pop_group (draw_tool);
|
gimp_draw_tool_pop_group (draw_tool);
|
||||||
}
|
|
||||||
|
|
||||||
/* draw the center */
|
/* draw the move handle */
|
||||||
if (tr_tool->use_center)
|
d = MIN (handle_w, handle_h);
|
||||||
{
|
|
||||||
GimpCanvasGroup *stroke_group;
|
|
||||||
gint d = MIN (handle_w, handle_h);
|
|
||||||
|
|
||||||
stroke_group = gimp_draw_tool_add_stroke_group (draw_tool);
|
stroke_group = gimp_draw_tool_add_stroke_group (draw_tool);
|
||||||
|
|
||||||
@ -340,7 +411,6 @@ gimp_unified_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
gimp_draw_tool_pop_group (draw_tool);
|
gimp_draw_tool_pop_group (draw_tool);
|
||||||
}
|
|
||||||
|
|
||||||
if (tr_tool->handles[tr_tool->function])
|
if (tr_tool->handles[tr_tool->function])
|
||||||
{
|
{
|
||||||
@ -348,6 +418,7 @@ gimp_unified_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* the rest of the function is the same as in the parent class */
|
||||||
if (options->type == GIMP_TRANSFORM_TYPE_SELECTION)
|
if (options->type == GIMP_TRANSFORM_TYPE_SELECTION)
|
||||||
{
|
{
|
||||||
GimpMatrix3 matrix = tr_tool->transform;
|
GimpMatrix3 matrix = tr_tool->transform;
|
||||||
@ -698,6 +769,9 @@ gimp_unified_transform_tool_motion (GimpTransformTool *transform_tool)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case TRANSFORM_HANDLE_CENTER:
|
case TRANSFORM_HANDLE_CENTER:
|
||||||
|
if (options->constrain) {
|
||||||
|
diff_y = diff_x;
|
||||||
|
}
|
||||||
*x[0] += diff_x;
|
*x[0] += diff_x;
|
||||||
*y[0] += diff_y;
|
*y[0] += diff_y;
|
||||||
*x[1] += diff_x;
|
*x[1] += diff_x;
|
||||||
|
Reference in New Issue
Block a user