app: reset overall transformation in transform tools
In GimpTransformGridTool, reset both transform directions in response to the "Reset" button, so that the overall transformation is restored to the identity. Previously, we would only reset the active transform direction (possibly compensating in the opposite direction, if both directions are linked). This was intentional, but it's probably a bit too confusing, especially in conjunction with the newly added "Readjust" button. Let's just go back to resetting everything.
This commit is contained in:
@ -1242,15 +1242,26 @@ gimp_transform_grid_tool_response (GimpToolGui *gui,
|
||||
switch (response_id)
|
||||
{
|
||||
case RESPONSE_RESET:
|
||||
{
|
||||
gboolean direction_linked;
|
||||
|
||||
/* restore the initial transformation info */
|
||||
memcpy (tg_tool->trans_info, tg_tool->init_trans_info,
|
||||
memcpy (tg_tool->trans_infos[GIMP_TRANSFORM_FORWARD],
|
||||
tg_tool->init_trans_info,
|
||||
sizeof (TransInfo));
|
||||
memcpy (tg_tool->trans_infos[GIMP_TRANSFORM_BACKWARD],
|
||||
tg_tool->init_trans_info,
|
||||
sizeof (TransInfo));
|
||||
|
||||
/* recalculate the tool's transformtion matrix */
|
||||
/* recalculate the tool's transformation matrix */
|
||||
direction_linked = tg_options->direction_linked;
|
||||
tg_options->direction_linked = FALSE;
|
||||
gimp_transform_tool_recalc_matrix (tr_tool, display);
|
||||
tg_options->direction_linked = direction_linked;
|
||||
|
||||
/* push the restored info to the undo stack */
|
||||
gimp_transform_grid_tool_push_internal_undo (tg_tool);
|
||||
}
|
||||
break;
|
||||
|
||||
case RESPONSE_READJUST:
|
||||
@ -1260,8 +1271,8 @@ gimp_transform_grid_tool_response (GimpToolGui *gui,
|
||||
/* readjust the transformation info */
|
||||
GIMP_TRANSFORM_GRID_TOOL_GET_CLASS (tg_tool)->readjust (tg_tool);
|
||||
|
||||
/* recalculate the tool's transformtion matrix, preserving the overall
|
||||
* transformation
|
||||
/* recalculate the tool's transformation matrix, preserving the
|
||||
* overall transformation
|
||||
*/
|
||||
direction_linked = tg_options->direction_linked;
|
||||
tg_options->direction_linked = TRUE;
|
||||
@ -1296,12 +1307,18 @@ gimp_transform_grid_tool_update_sensitivity (GimpTransformGridTool *tg_tool)
|
||||
if (! tg_tool->gui)
|
||||
return;
|
||||
|
||||
gimp_tool_gui_set_response_sensitive (tg_tool->gui, GTK_RESPONSE_OK,
|
||||
gimp_tool_gui_set_response_sensitive (
|
||||
tg_tool->gui, GTK_RESPONSE_OK,
|
||||
tr_tool->transform_valid);
|
||||
gimp_tool_gui_set_response_sensitive (tg_tool->gui, RESPONSE_RESET,
|
||||
memcmp (tg_tool->trans_info,
|
||||
|
||||
gimp_tool_gui_set_response_sensitive (
|
||||
tg_tool->gui, RESPONSE_RESET,
|
||||
memcmp (tg_tool->trans_infos[GIMP_TRANSFORM_FORWARD],
|
||||
tg_tool->init_trans_info,
|
||||
sizeof (TransInfo)) != 0);
|
||||
sizeof (TransInfo)) ||
|
||||
memcmp (tg_tool->trans_infos[GIMP_TRANSFORM_BACKWARD],
|
||||
tg_tool->init_trans_info,
|
||||
sizeof (TransInfo)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user