Commit fd4b557f authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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
parent e67cf94f
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):
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment