mirror of https://github.com/GNOME/gimp.git
app: fix right-click cancelling a transform tool
to only revert back to before the current drag, not do a full reset
This commit is contained in:
parent
d6e76a10d6
commit
372bc90f65
|
@ -209,8 +209,9 @@ gimp_transform_tool_init (GimpTransformTool *tr_tool)
|
||||||
|
|
||||||
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
||||||
{
|
{
|
||||||
tr_tool->trans_info[i] = 0.0;
|
tr_tool->trans_info[i] = 0.0;
|
||||||
tr_tool->old_trans_info[i] = 0.0;
|
tr_tool->old_trans_info[i] = 0.0;
|
||||||
|
tr_tool->prev_trans_info[i] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_matrix3_identity (&tr_tool->transform);
|
gimp_matrix3_identity (&tr_tool->transform);
|
||||||
|
@ -347,7 +348,10 @@ gimp_transform_tool_initialize (GimpTool *tool,
|
||||||
|
|
||||||
/* Save the current transformation info */
|
/* Save the current transformation info */
|
||||||
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
||||||
tr_tool->old_trans_info[i] = tr_tool->trans_info[i];
|
{
|
||||||
|
tr_tool->old_trans_info[i] = tr_tool->trans_info[i];
|
||||||
|
tr_tool->prev_trans_info[i] = tr_tool->trans_info[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -419,6 +423,10 @@ gimp_transform_tool_button_release (GimpTool *tool,
|
||||||
{
|
{
|
||||||
gimp_transform_tool_response (NULL, GTK_RESPONSE_OK, tr_tool);
|
gimp_transform_tool_response (NULL, GTK_RESPONSE_OK, tr_tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Restore the previous transformation info */
|
||||||
|
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
||||||
|
tr_tool->prev_trans_info[i] = tr_tool->trans_info[i];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -426,7 +434,7 @@ gimp_transform_tool_button_release (GimpTool *tool,
|
||||||
|
|
||||||
/* Restore the previous transformation info */
|
/* Restore the previous transformation info */
|
||||||
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
for (i = 0; i < TRANS_INFO_SIZE; i++)
|
||||||
tr_tool->trans_info[i] = tr_tool->old_trans_info[i];
|
tr_tool->trans_info[i] = tr_tool->prev_trans_info[i];
|
||||||
|
|
||||||
/* reget the selection bounds */
|
/* reget the selection bounds */
|
||||||
gimp_transform_tool_bounds (tr_tool, display);
|
gimp_transform_tool_bounds (tr_tool, display);
|
||||||
|
|
|
@ -69,8 +69,8 @@ struct _GimpTransformTool
|
||||||
|
|
||||||
GimpMatrix3 transform; /* transformation matrix */
|
GimpMatrix3 transform; /* transformation matrix */
|
||||||
TransInfo trans_info; /* transformation info */
|
TransInfo trans_info; /* transformation info */
|
||||||
|
TransInfo old_trans_info; /* for resetting everything */
|
||||||
TransInfo old_trans_info; /* for cancelling a drag operation */
|
TransInfo prev_trans_info; /* for cancelling a drag operation */
|
||||||
|
|
||||||
TileManager *original; /* pointer to original tiles */
|
TileManager *original; /* pointer to original tiles */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue