From 9635f6006441bd729ae03f544cfdb88f6de286a6 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 13 Aug 2007 17:00:52 +0000 Subject: [PATCH] Use clutter_container_find_child_by_id() when picking ClutterStage now uses the newly added clutter_container_find_child_by_id() function to find the right child in the scenegraph, using the picking id. This fixes the test-boxes test case. --- clutter/clutter-stage.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index f248c33ec..196c8d3d5 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -873,8 +873,8 @@ clutter_stage_get_actor_at_pos (ClutterStage *stage, context->pick_mode = FALSE; /* Calls should work under both GL and GLES, note GLES needs RGBA */ - glGetIntegerv(GL_VIEWPORT, viewport); - glReadPixels(x, viewport[3] - y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); + glGetIntegerv (GL_VIEWPORT, viewport); + glReadPixels (x, viewport[3] - y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff) return CLUTTER_ACTOR(stage); @@ -882,9 +882,11 @@ clutter_stage_get_actor_at_pos (ClutterStage *stage, cogl_get_bitmasks (&r, &g, &b, NULL); /* Decode color back into an ID, taking into account fb depth */ - id = pixel[2]>>(8-b) | pixel[1]<>(8-g) | pixel[0]<<(g+b)>>(8-r); + id = pixel[2] >> (8 - b) + | pixel[1] << b >> (8 - g) + | pixel[0] << (g + b) >> (8 - r); - return clutter_group_find_child_by_id (CLUTTER_GROUP (stage), id); + return clutter_container_find_child_by_id (CLUTTER_CONTAINER (stage), id); } /**