applied patch from Alexia Death that introduces smoothing for the stroke

2009-02-10  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-coords.c
	(gimp_display_shell_eval_event): applied patch from Alexia Death
	that introduces smoothing for the stroke direction (bug 
#520078).


svn path=/trunk/; revision=28009
This commit is contained in:
Sven Neumann 2009-02-10 19:45:37 +00:00 committed by Sven Neumann
parent e67cf94ffb
commit fd4b557fd7
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-02-10 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): applied patch from Alexia Death
that introduces smoothing for the stroke direction (bug #520078).
2009-02-09 Sven Neumann <sven@gimp.org>
* app/actions/tools-commands.c (tools_paint_brush_angle_cmd_callback):

View File

@ -224,7 +224,6 @@ gimp_display_shell_eval_event (GimpDisplayShell *shell,
gdouble delta_y = 0.0;
gdouble distance = 1.0;
gboolean event_fill = (inertia_factor > 0);
gint i;
/* Smoothing causes problems with cursor tracking
* when zoomed above screen resolution so we need to supress it.
@ -245,6 +244,7 @@ gimp_display_shell_eval_event (GimpDisplayShell *shell,
{
gdouble filter;
gdouble dist;
gdouble delta_dir;
delta_x = shell->last_coords.x - coords->x;
delta_y = shell->last_coords.y - coords->y;
@ -292,7 +292,7 @@ gimp_display_shell_eval_event (GimpDisplayShell *shell,
coords->velocity = MIN (coords->velocity, 1.0);
}
if (delta_x == 0)
if (delta_x == 0.0)
{
coords->direction = shell->last_coords.direction;
}
@ -303,6 +303,14 @@ gimp_display_shell_eval_event (GimpDisplayShell *shell,
coords->direction = coords->direction + 0.5;
}
delta_dir = coords->direction - shell->last_coords.direction;
if ((fabs (delta_dir) > 0.5) && (delta_dir < 0.0))
coords->direction = 0.3 * coords->direction + 0.7 * (shell->last_coords.direction - 1.0);
else if ((fabs (delta_dir) > 0.5) && (delta_dir > 0.0))
coords->direction = 0.3 * coords->direction + 0.7 * (shell->last_coords.direction + 1.0);
else
coords->direction = 0.3 * coords->direction + 0.7 * shell->last_coords.direction;
/* High speed -> less smooth*/
inertia_factor *= (1 - coords->velocity);