1
0
Fork 0

Avoid motion-compression in test-picking test

Using clutter_stage_get_actor_at_pos() rather than synthesizing
events; the synthesized events were being compressed, so we were
only tesitng one pick per frame.

http://bugzilla.openedhand.com/show_bug.cgi?id=1637

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Owen W. Taylor 2009-06-06 22:55:34 -04:00 committed by Emmanuele Bassi
parent 6e69692e22
commit fc83e36477

View file

@ -36,7 +36,6 @@ do_events (ClutterActor *stage)
{
glong i;
static gdouble angle = 0;
ClutterEvent event;
for (i = 0; i < n_events; i++)
{
@ -44,18 +43,13 @@ do_events (ClutterActor *stage)
while (angle > M_PI * 2.0)
angle -= M_PI * 2.0;
event.type = CLUTTER_MOTION;
event.any.stage = CLUTTER_STAGE (stage);
event.any.time = CLUTTER_CURRENT_TIME;
event.motion.flags = 0;
event.motion.source = NULL;
event.motion.x = (gint)(256.0 + 206.0 * cos (angle));
event.motion.y = (gint)(256.0 + 206.0 * sin (angle));
event.motion.modifier_state = 0;
event.motion.axes = NULL;
event.motion.device = NULL;
clutter_event_put (&event);
/* If we synthesized events, they would be motion compressed;
* calling get_actor_at_position() doesn't have that problem
*/
clutter_stage_get_actor_at_pos (CLUTTER_STAGE (stage),
CLUTTER_PICK_REACTIVE,
256.0 + 206.0 * cos (angle),
256.0 + 206.0 * sin (angle));
}
}