diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 20070df4e..0d5eae782 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -635,6 +635,7 @@ #include "clutter-paint-nodes.h" #include "clutter-paint-node-private.h" #include "clutter-paint-volume-private.h" +#include "clutter-pick-context-private.h" #include "clutter-private.h" #include "clutter-property-transition.h" #include "clutter-scriptable.h" @@ -3959,6 +3960,15 @@ clutter_actor_pick (ClutterActor *actor, /* mark that we are in the paint process */ CLUTTER_SET_PRIVATE_FLAGS (actor, CLUTTER_IN_PICK); + if (priv->paint_volume_valid && priv->last_paint_volume_valid) + { + graphene_box_t box; + + clutter_paint_volume_to_box (&priv->last_paint_volume, &box); + if (!clutter_pick_context_intersects_box (pick_context, &box)) + goto out; + } + if (priv->enable_model_view_transform) { graphene_matrix_t matrix; @@ -4007,6 +4017,7 @@ clutter_actor_pick (ClutterActor *actor, if (transform_pushed) clutter_pick_context_pop_transform (pick_context); +out: /* paint sequence complete */ CLUTTER_UNSET_PRIVATE_FLAGS (actor, CLUTTER_IN_PICK); } diff --git a/clutter/clutter/clutter-pick-context-private.h b/clutter/clutter/clutter-pick-context-private.h index cc8baf881..f40de6f3d 100644 --- a/clutter/clutter/clutter-pick-context-private.h +++ b/clutter/clutter/clutter-pick-context-private.h @@ -30,4 +30,8 @@ clutter_pick_context_new_for_view (ClutterStageView *view, ClutterPickStack * clutter_pick_context_steal_stack (ClutterPickContext *pick_context); +gboolean +clutter_pick_context_intersects_box (ClutterPickContext *pick_context, + const graphene_box_t *box); + #endif /* CLUTTER_PICK_CONTEXT_PRIVATE_H */ diff --git a/clutter/clutter/clutter-pick-context.c b/clutter/clutter/clutter-pick-context.c index b9758366d..2f054d318 100644 --- a/clutter/clutter/clutter-pick-context.c +++ b/clutter/clutter/clutter-pick-context.c @@ -189,3 +189,11 @@ clutter_pick_context_pop_transform (ClutterPickContext *pick_context) { clutter_pick_stack_pop_transform (pick_context->pick_stack); } + +gboolean +clutter_pick_context_intersects_box (ClutterPickContext *pick_context, + const graphene_box_t *box) +{ + return graphene_box_contains_point (box, &pick_context->point) || + graphene_ray_intersects_box (&pick_context->ray, box); +}