[gimp] app: gimp_motion_buffer_eval_event(): always set last_read_motion_time
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: gimp_motion_buffer_eval_event(): always set last_read_motion_time
- Date: Sun, 17 Apr 2011 17:35:05 +0000 (UTC)
commit 41b469fcf53fd9dbdeee307733e2c9a3095e1c0a
Author: Michael Natterer <mitch gimp org>
Date: Sun Apr 17 19:34:02 2011 +0200
app: gimp_motion_buffer_eval_event(): always set last_read_motion_time
We need it for correctly requesting device history, so we must
remember it also when returning FALSE and ignoring the event.
app/display/gimpmotionbuffer.c | 7 +++++--
app/display/gimpmotionbuffer.h | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/app/display/gimpmotionbuffer.c b/app/display/gimpmotionbuffer.c
index 0144e61..822b145 100644
--- a/app/display/gimpmotionbuffer.c
+++ b/app/display/gimpmotionbuffer.c
@@ -218,6 +218,11 @@ gimp_motion_buffer_eval_event (GimpMotionBuffer *buffer,
gdouble distance = 1.0;
gboolean event_fill = (inertia_factor > 0.0);
+ /* the last_read_motion_time most be set unconditionally, so set
+ * it early
+ */
+ buffer->last_read_motion_time = time;
+
/* Smoothing causes problems with cursor tracking when zoomed above
* screen resolution so we need to supress it.
*/
@@ -377,8 +382,6 @@ gimp_motion_buffer_eval_event (GimpMotionBuffer *buffer,
g_array_append_val (buffer->event_queue, *coords);
- buffer->last_read_motion_time = time;
-
buffer->last_coords = *coords;
buffer->last_motion_time = time;
buffer->last_motion_delta_time = delta_time;
diff --git a/app/display/gimpmotionbuffer.h b/app/display/gimpmotionbuffer.h
index 4a53c89..2f98fd7 100644
--- a/app/display/gimpmotionbuffer.h
+++ b/app/display/gimpmotionbuffer.h
@@ -38,8 +38,9 @@ struct _GimpMotionBuffer
{
GimpObject parent_instance;
- guint32 last_motion_time; /* previous time of a forwarded motion event */
guint32 last_read_motion_time;
+
+ guint32 last_motion_time; /* previous time of a forwarded motion event */
gdouble last_motion_delta_time;
gdouble last_motion_delta_x;
gdouble last_motion_delta_y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]