[gimp/soc-2012-unified-transformation: 47/52] transformtool: Add back tooltip code that was deleted when I made pick_function
- From: Mikael Magnusson <mikachu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2012-unified-transformation: 47/52] transformtool: Add back tooltip code that was deleted when I made pick_function
- Date: Sat, 18 Aug 2012 17:31:32 +0000 (UTC)
commit dd1ede014260a52d51eda66c2d65694d4e885330
Author: Mikael Magnusson <mikachu src gnome org>
Date: Wed Aug 15 15:47:09 2012 +0200
transformtool: Add back tooltip code that was deleted when I made pick_function
app/tools/gimpunifiedtransformtool.c | 49 ++++++++++++++++++++-------------
1 files changed, 30 insertions(+), 19 deletions(-)
---
diff --git a/app/tools/gimpunifiedtransformtool.c b/app/tools/gimpunifiedtransformtool.c
index 43d2bd6..4a59609 100644
--- a/app/tools/gimpunifiedtransformtool.c
+++ b/app/tools/gimpunifiedtransformtool.c
@@ -160,25 +160,36 @@ gimp_unified_transform_tool_pick_function (GimpTransformTool *tr_tool,
GdkModifierType state,
GimpDisplay *display)
{
- TransformAction i;
+ TransformAction ret = TRANSFORM_HANDLE_NONE, i;
+ GimpTool *tool = GIMP_TOOL (tr_tool);
- for (i = TRANSFORM_HANDLE_NONE + 1; i < TRANSFORM_HANDLE_NUM; i++) {
- if (gimp_canvas_item_hit (tr_tool->handles[i], coords->x, coords->y))
- {
- return i;
- }
- }
-
- /* points passed in clockwise order */
- if (point_is_inside_polygon (4,
- (gdouble[4]){ tr_tool->tx1, tr_tool->tx2,
- tr_tool->tx4, tr_tool->tx3 },
- (gdouble[4]){ tr_tool->ty1, tr_tool->ty2,
- tr_tool->ty4, tr_tool->ty3 },
- coords->x, coords->y))
- return TRANSFORM_HANDLE_CENTER;
-
- return TRANSFORM_HANDLE_NONE;
+ for (i = TRANSFORM_HANDLE_NONE + 1; i < TRANSFORM_HANDLE_NUM; i++)
+ {
+ if (gimp_canvas_item_hit (tr_tool->handles[i], coords->x, coords->y))
+ {
+ ret = i;
+ break;
+ }
+ }
+
+ if (ret == TRANSFORM_HANDLE_NONE)
+ {
+ /* points passed in clockwise order */
+ if (point_is_inside_polygon (4,
+ (gdouble[4]){ tr_tool->tx1, tr_tool->tx2,
+ tr_tool->tx4, tr_tool->tx3 },
+ (gdouble[4]){ tr_tool->ty1, tr_tool->ty2,
+ tr_tool->ty4, tr_tool->ty3 },
+ coords->x, coords->y))
+ ret = TRANSFORM_HANDLE_CENTER;
+ }
+
+ gimp_tool_pop_status (tool, tool->display);
+
+ if (ret != TRANSFORM_HANDLE_NONE)
+ gimp_tool_push_status (tool, tool->display, "%i", ret);
+
+ return ret;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]