app: improve rotate-tool undo description
When rotating an item around its center using the rotate tool, i.e., if the pivot point hasn't been moved, don't include the pivot coordinates in the undo description.
This commit is contained in:
parent
b95bf3fb93
commit
44c8a1f274
1 changed files with 15 additions and 5 deletions
|
|
@ -187,11 +187,21 @@ gimp_rotate_tool_get_undo_desc (GimpTransformTool *tr_tool)
|
|||
{
|
||||
GimpTransformGridTool *tg_tool = GIMP_TRANSFORM_GRID_TOOL (tr_tool);
|
||||
|
||||
return g_strdup_printf (C_("undo-type",
|
||||
"Rotate by %-3.3g° around (%g, %g)"),
|
||||
gimp_rad_to_deg (tg_tool->trans_info[ANGLE]),
|
||||
tg_tool->trans_info[PIVOT_X],
|
||||
tg_tool->trans_info[PIVOT_Y]);
|
||||
if (tg_tool->trans_info[PIVOT_X] == (tr_tool->x1 + tr_tool->x2) / 2.0 &&
|
||||
tg_tool->trans_info[PIVOT_Y] == (tr_tool->y1 + tr_tool->y2) / 2.0)
|
||||
{
|
||||
return g_strdup_printf (C_("undo-type",
|
||||
"Rotate by %-3.3g°"),
|
||||
gimp_rad_to_deg (tg_tool->trans_info[ANGLE]));
|
||||
}
|
||||
else
|
||||
{
|
||||
return g_strdup_printf (C_("undo-type",
|
||||
"Rotate by %-3.3g° around (%g, %g)"),
|
||||
gimp_rad_to_deg (tg_tool->trans_info[ANGLE]),
|
||||
tg_tool->trans_info[PIVOT_X],
|
||||
tg_tool->trans_info[PIVOT_Y]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue