Commit 44c8a1f2 authored by Ell's avatar Ell

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.
parent b95bf3fb
......@@ -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
......
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