[gimp] app: improve rotate-tool undo description
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: improve rotate-tool undo description
- Date: Mon, 4 Feb 2019 21:53:30 +0000 (UTC)
commit 44c8a1f27494c6717bda6664f53e81b7b47090d5
Author: Ell <ell_se yahoo com>
Date: Mon Feb 4 09:52:53 2019 -0500
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.
app/tools/gimprotatetool.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c
index cd5fe2b84f..0b16ddea2c 100644
--- a/app/tools/gimprotatetool.c
+++ b/app/tools/gimprotatetool.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]