Commit 4e3026c6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

handle event time as guint32. That's the type we deal with here and it

2005-01-03  Sven Neumann  <sven@gimp.org>

	* app/paint/gimpink.[ch]: handle event time as guint32. That's the
	type we deal with here and it avoids a crash that occured when
	autoscrolling with the Ink tool.

	* app/display/gimpdisplayshell-autoscroll.c: cosmetics.
parent aef1cf93
2005-01-03 Sven Neumann <sven@gimp.org>
* app/paint/gimpink.[ch]: handle event time as guint32. That's the
type we deal with here and it avoids a crash that occured when
autoscrolling with the Ink tool.
* app/display/gimpdisplayshell-autoscroll.c: cosmetics.
2005-01-02 Michael Natterer <mitch@gimp.org>
* app/display/Makefile.am
......
......@@ -110,47 +110,49 @@ static gboolean
gimp_display_shell_autoscroll_timeout (gpointer data)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
GimpDisplay *gdisp = shell->gdisp;
ScrollInfo *info = shell->scroll_info;
GimpCoords device_coords;
GimpCoords image_coords;
gint off_x = 0;
gint off_y = 0;
gint dx = 0;
gint dy = 0;
info->time += AUTOSCROLL_DT;
gimp_display_shell_get_device_coords (shell,
info->device, &device_coords);
gimp_display_shell_get_device_coords (shell, info->device, &device_coords);
if (device_coords.x < 0)
off_x = device_coords.x;
dx = device_coords.x;
else if (device_coords.x > shell->disp_width)
off_x = device_coords.x - shell->disp_width;
dx = device_coords.x - shell->disp_width;
if (device_coords.y < 0)
off_y = device_coords.y;
dy = device_coords.y;
else if (device_coords.y > shell->disp_height)
off_y = device_coords.y - shell->disp_height;
dy = device_coords.y - shell->disp_height;
if (off_x == 0 && off_y == 0)
if (dx || dy)
{
g_free (info);
shell->scroll_info = NULL;
GimpDisplay *gdisp = shell->gdisp;
return FALSE;
}
info->time += AUTOSCROLL_DT;
gimp_display_shell_scroll (shell,
AUTOSCROLL_DX * (gdouble) dx,
AUTOSCROLL_DX * (gdouble) dy);
gimp_display_shell_scroll (shell,
AUTOSCROLL_DX * (gdouble) off_x,
AUTOSCROLL_DX * (gdouble) off_y);
gimp_display_shell_untransform_coords (shell,
&device_coords, &image_coords);
gimp_display_shell_untransform_coords (shell,
&device_coords, &image_coords);
tool_manager_motion_active (gdisp->gimage->gimp,
&image_coords,
info->time, info->state,
gdisp);
tool_manager_motion_active (gdisp->gimage->gimp,
&image_coords,
info->time, info->state,
gdisp);
return TRUE;
}
else
{
g_free (info);
shell->scroll_info = NULL;
return TRUE;
return FALSE;
}
}
......@@ -270,11 +270,10 @@ gimp_ink_motion (GimpPaintCore *paint_core,
else
{
Blob *blob;
gdouble lasttime, thistime;
gdouble dist;
gdouble velocity;
lasttime = ink->last_time;
guint32 lasttime = ink->last_time;
guint32 thistime;
time_smoother_add (ink, time);
thistime = ink->last_time = time_smoother_result (ink);
......
......@@ -54,7 +54,7 @@ struct _GimpInk
guint32 ts_buffer[TIME_SMOOTHER_BUFFER];
gint ts_index;
gdouble last_time; /* previous time of a motion event */
guint32 last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
gboolean init_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