Commit 5f7e1ac3 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

cleanup.

2006-06-19  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpscaletool.c (gimp_scale_tool_motion): cleanup.

	* app/tools/gimptransformtool.c
(gimp_transform_tool_cursor_update):
	simplified; removed checks that didn't change the cursor anyway.
parent 5e0b401f
2006-06-19 Sven Neumann <sven@gimp.org>
* app/tools/gimptransformtool.c (gimp_transform_tool_cursor_update):
simplified, removed checks that didn't change the cursor anyway.
* app/tools/gimpscaletool.c (gimp_scale_tool_motion): cleanup.
2006-06-18 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.[ch]: added virtual functions
......
......@@ -186,16 +186,10 @@ gimp_scale_tool_motion (GimpTransformTool *tr_tool,
gdouble *y1;
gdouble *x2;
gdouble *y2;
gint dir_x, dir_y;
gdouble diff_x, diff_y;
options =
GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
diff_x = tr_tool->curx - tr_tool->lastx;
diff_y = tr_tool->cury - tr_tool->lasty;
g_printerr ("%d\n", tr_tool->function);
gint dir_x;
gint dir_y;
gdouble diff_x = tr_tool->curx - tr_tool->lastx;
gdouble diff_y = tr_tool->cury - tr_tool->lasty;
switch (tr_tool->function)
{
......@@ -249,6 +243,9 @@ gimp_scale_tool_motion (GimpTransformTool *tr_tool,
}
/* if control is being held, constrain the aspect ratio */
options =
GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
if (options->constrain)
{
gdouble mag;
......
......@@ -608,34 +608,19 @@ gimp_transform_tool_cursor_update (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tool);
GimpTransformOptions *options;
options = GIMP_TRANSFORM_OPTIONS (tool->tool_info->tool_options);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tool);
if (tr_tool->use_grid)
{
GimpChannel *selection = gimp_image_get_mask (display->image);
GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
GimpTransformOptions *options;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_TRANSFORM_OPTIONS (tool->tool_info->tool_options);
switch (options->type)
{
case GIMP_TRANSFORM_TYPE_LAYER:
if (gimp_image_coords_in_active_pickable (display->image, coords,
FALSE, TRUE))
{
cursor = GIMP_CURSOR_MOUSE;
}
break;
case GIMP_TRANSFORM_TYPE_SELECTION:
if (gimp_channel_is_empty (selection) ||
gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
coords->x, coords->y))
{
cursor = GIMP_CURSOR_MOUSE;
}
break;
case GIMP_TRANSFORM_TYPE_PATH:
......@@ -650,7 +635,6 @@ gimp_transform_tool_cursor_update (GimpTool *tool,
modifier = GIMP_CURSOR_MODIFIER_MOVE;
}
gimp_tool_control_set_cursor (tool->control, cursor);
gimp_tool_control_set_cursor_modifier (tool->control, modifier);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment