use the newly added GimpGradient API to set the segment's handles instead

2004-06-03  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpgradienteditor.c (control_motion): use the newly
	added GimpGradient API to set the segment's handles instead of
	setting the values directly. Dirties the gradient correctly and
	makes the preview update instantly again. Fixes bug #143605.
This commit is contained in:
Michael Natterer 2004-06-02 22:50:15 +00:00 committed by Michael Natterer
parent 7bfee0413d
commit 1d31d62c30
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2004-06-03 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpgradienteditor.c (control_motion): use the newly
added GimpGradient API to set the segment's handles instead of
setting the values directly. Dirties the gradient correctly and
makes the preview update instantly again. Fixes bug #143605.
2004-06-03 Sven Neumann <sven@gimp.org>
* app/gui/file-open-location-dialog.c

View File

@ -1389,9 +1389,7 @@ control_motion (GimpGradientEditor *editor,
pos = control_calc_g_pos (editor, x);
if (! editor->control_compress)
seg->prev->right = seg->left = CLAMP (pos,
seg->prev->middle + EPSILON,
seg->middle - EPSILON);
gimp_gradient_segment_set_left_pos (gradient, seg, pos);
else
control_compress_left (gradient,
editor->control_sel_l,
@ -1404,7 +1402,8 @@ control_motion (GimpGradientEditor *editor,
case GRAD_DRAG_MIDDLE:
pos = control_calc_g_pos (editor, x);
seg->middle = CLAMP (pos, seg->left + EPSILON, seg->right - EPSILON);
gimp_gradient_segment_set_middle_pos (gradient, seg, pos);
str = g_strdup_printf (_("Handle position: %0.6f"), seg->middle);
gradient_editor_set_hint (editor, str, "", "");