When applying angle constraints on the first segment vertex, base on the

2008-06-21  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpfreeselecttool.c
	(gimp_free_select_tool_update_motion): When applying angle
	constraints on the first segment vertex, base on the last segment
	vertex rather than not applying any constraint at all.

svn path=/trunk/; revision=25972
This commit is contained in:
Martin Nordholts 2008-06-21 09:39:49 +00:00 committed by Martin Nordholts
parent 3c339adacb
commit e068c051f1
2 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2008-06-21 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimpfreeselecttool.c
(gimp_free_select_tool_update_motion): When applying angle
constraints on the first segment vertex, base on the last segment
vertex rather than not applying any constraint at all.
2008-06-20 Martin Nordholts <martinn@svn.gnome.org>
Make angle constraints with the Free Select Tool by using Ctrl

View File

@ -1029,17 +1029,30 @@ gimp_free_select_tool_update_motion (GimpFreeSelectTool *fst,
{
priv->polygon_modified = TRUE;
if (priv->constrain_angle &&
priv->grabbed_segment_index > 0 &&
priv->n_points > 0 )
if (priv->constrain_angle &&
priv->n_segment_indices > 1 )
{
gdouble start_point_x;
gdouble start_point_y;
gint segment_index;
/* Base constraints on the last segment vertex if we move
* the first one, otherwise base on the previous segment
* vertex
*/
if (priv->grabbed_segment_index == 0)
{
segment_index = priv->n_segment_indices - 1;
}
else
{
segment_index = priv->grabbed_segment_index - 1;
}
gimp_free_select_tool_get_segment_point (fst,
&start_point_x,
&start_point_y,
priv->grabbed_segment_index - 1);
segment_index);
gimp_tool_motion_constrain (start_point_x,
start_point_y,