[gimp/metadata-browser] transformtool: adjust handles a bit
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] transformtool: adjust handles a bit
- Date: Thu, 13 Sep 2012 00:37:01 +0000 (UTC)
commit a4edd4fab10685b6dfb175f0970acfe0bce41627
Author: Mikael Magnusson <mikachu src gnome org>
Date: Wed Aug 22 16:51:49 2012 +0200
transformtool: adjust handles a bit
Since the move handle is gone, the pivot can be normal sized and circle again,
also put shear handles at 3/4 rather than 3/5.
app/tools/gimptransformtool.c | 8 +++++---
app/tools/gimpunifiedtransformtool.c | 20 ++++++++++----------
2 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index d17e25a..4cdeef1 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -880,7 +880,9 @@ gimp_transform_tool_real_draw_gui (GimpTransformTool *tr_tool, gint handle_w, gi
if (tr_tool->use_pivot)
{
GimpCanvasGroup *stroke_group;
- gint d = MIN (handle_w, handle_h) * 2; /* so you can grab it from under the center handle */
+ gint d = MIN (handle_w, handle_h);
+ if (tr_tool->use_center)
+ d *= 2; /* so you can grab it from under the center handle */
stroke_group = gimp_draw_tool_add_stroke_group (draw_tool);
@@ -889,7 +891,7 @@ gimp_transform_tool_real_draw_gui (GimpTransformTool *tr_tool, gint handle_w, gi
gimp_draw_tool_push_group (draw_tool, stroke_group);
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_SQUARE,
+ GIMP_HANDLE_CIRCLE,
tr_tool->tpx, tr_tool->tpy,
d, d,
GIMP_HANDLE_ANCHOR_CENTER);
@@ -915,7 +917,7 @@ gimp_transform_tool_real_draw_gui (GimpTransformTool *tr_tool, gint handle_w, gi
gimp_draw_tool_push_group (draw_tool, stroke_group);
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_CIRCLE,
+ GIMP_HANDLE_SQUARE,
tr_tool->tcx, tr_tool->tcy,
d, d,
GIMP_HANDLE_ANCHOR_CENTER);
diff --git a/app/tools/gimpunifiedtransformtool.c b/app/tools/gimpunifiedtransformtool.c
index 803229a..eb41688 100644
--- a/app/tools/gimpunifiedtransformtool.c
+++ b/app/tools/gimpunifiedtransformtool.c
@@ -352,14 +352,14 @@ gimp_unified_transform_tool_draw_gui (GimpTransformTool *tr_tool,
GIMP_HANDLE_ANCHOR_CENTER);
/* draw the shear handles */
- tx[0] = (tr_tool->tx1 * 2.0 + tr_tool->tx2 * 3.0) / 5.0;
- ty[0] = (tr_tool->ty1 * 2.0 + tr_tool->ty2 * 3.0) / 5.0;
- tx[1] = (tr_tool->tx3 * 3.0 + tr_tool->tx4 * 2.0) / 5.0;
- ty[1] = (tr_tool->ty3 * 3.0 + tr_tool->ty4 * 2.0) / 5.0;
- tx[2] = (tr_tool->tx2 * 2.0 + tr_tool->tx4 * 3.0) / 5.0;
- ty[2] = (tr_tool->ty2 * 2.0 + tr_tool->ty4 * 3.0) / 5.0;
- tx[3] = (tr_tool->tx3 * 3.0 + tr_tool->tx1 * 2.0) / 5.0;
- ty[3] = (tr_tool->ty3 * 3.0 + tr_tool->ty1 * 2.0) / 5.0;
+ tx[0] = (tr_tool->tx1 * 1.0 + tr_tool->tx2 * 3.0) / 4.0;
+ ty[0] = (tr_tool->ty1 * 1.0 + tr_tool->ty2 * 3.0) / 4.0;
+ tx[1] = (tr_tool->tx3 * 3.0 + tr_tool->tx4 * 1.0) / 4.0;
+ ty[1] = (tr_tool->ty3 * 3.0 + tr_tool->ty4 * 1.0) / 4.0;
+ tx[2] = (tr_tool->tx2 * 1.0 + tr_tool->tx4 * 3.0) / 4.0;
+ ty[2] = (tr_tool->ty2 * 1.0 + tr_tool->ty4 * 3.0) / 4.0;
+ tx[3] = (tr_tool->tx3 * 3.0 + tr_tool->tx1 * 1.0) / 4.0;
+ ty[3] = (tr_tool->ty3 * 3.0 + tr_tool->ty1 * 1.0) / 4.0;
for (i = 0; i < 4; i++)
tr_tool->handles[TRANSFORM_HANDLE_N_S + i] =
@@ -370,7 +370,7 @@ gimp_unified_transform_tool_draw_gui (GimpTransformTool *tr_tool,
GIMP_HANDLE_ANCHOR_CENTER);
/* draw the rotation center axis handle */
- d = MIN (handle_w, handle_h) * 2.0; /* so you can grab it from under the center handle */
+ d = MIN (handle_w, handle_h);
stroke_group = gimp_draw_tool_add_stroke_group (draw_tool);
@@ -379,7 +379,7 @@ gimp_unified_transform_tool_draw_gui (GimpTransformTool *tr_tool,
gimp_draw_tool_push_group (draw_tool, stroke_group);
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_SQUARE,
+ GIMP_HANDLE_CIRCLE,
tr_tool->tpx, tr_tool->tpy,
d, d,
GIMP_HANDLE_ANCHOR_CENTER);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]