[gimp/blend-tool-fun: 9/10] app: When constraining angles, don't allow points to get out of line.



commit d533e45e7676f5a5d9c9eb7e17766a90ea8e8441
Author: Michael Henning <drawoc darkrefraction com>
Date:   Tue Jun 24 20:27:58 2014 -0400

    app: When constraining angles, don't allow points to get out of line.

 app/tools/gimpblendtool.c |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 9b81ede..5d8fe95 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -298,28 +298,19 @@ gimp_blend_tool_button_press (GimpTool            *tool,
       gimp_blend_tool_halt (blend_tool);
     }
 
-  switch (gimp_blend_tool_get_point_under_cursor (blend_tool))
-    {
-    case POINT_NONE:
-      blend_tool->start_x = coords->x;
-      blend_tool->start_y = coords->y;
-      /* fall thru */
-
-    case POINT_END:
-      blend_tool->end_x = coords->x;
-      blend_tool->end_y = coords->y;
+  blend_tool->grabbed_point = gimp_blend_tool_get_point_under_cursor (blend_tool);
 
+  if (blend_tool->grabbed_point == POINT_NONE)
+    {
       blend_tool->grabbed_point = POINT_END;
-      break;
 
-    case POINT_START:
       blend_tool->start_x = coords->x;
       blend_tool->start_y = coords->y;
-
-      blend_tool->grabbed_point = POINT_START;
-      break;
     }
 
+  gimp_blend_tool_point_motion (blend_tool,
+                                state & gimp_get_constrain_behavior_mask ());
+
   /*
    * gimp_blend_tool_start comes after determining what point is grabbed, so
    * whenever we're starting the tool, gimp_blend_tool_get_point_under_cursor()
@@ -405,7 +396,7 @@ gimp_blend_tool_motion (GimpTool         *tool,
 
 static void
 gimp_blend_tool_point_motion (GimpBlendTool *blend_tool,
-                              gboolean constrain_angle)
+                              gboolean       constrain_angle)
 {
   switch (blend_tool->grabbed_point)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]