mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
surface-actor: Allow checking if a surface actor covers a rect
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This commit is contained in:
parent
f5e5032eac
commit
4e5ac0186c
@ -537,6 +537,22 @@ meta_surface_actor_is_obscured_on_stage_view (MetaSurfaceActor *self,
|
||||
stage_view);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_contains_rect (MetaSurfaceActor *surface_actor,
|
||||
MtkRectangle *rect)
|
||||
{
|
||||
ClutterActor *actor = CLUTTER_ACTOR (surface_actor);
|
||||
graphene_rect_t bounding_rect;
|
||||
graphene_rect_t bound_rect;
|
||||
|
||||
clutter_actor_get_transformed_extents (actor, &bounding_rect);
|
||||
|
||||
bound_rect = mtk_rectangle_to_graphene_rect (rect);
|
||||
|
||||
return graphene_rect_contains_rect (&bounding_rect,
|
||||
&bound_rect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_set_input_region (MetaSurfaceActor *self,
|
||||
MtkRegion *region)
|
||||
|
@ -40,6 +40,9 @@ gboolean meta_surface_actor_is_obscured_on_stage_view (MetaSurfaceActor *self,
|
||||
ClutterStageView *stage_view,
|
||||
float *unobscurred_fraction);
|
||||
|
||||
gboolean meta_surface_actor_contains_rect (MetaSurfaceActor *surface_actor,
|
||||
MtkRectangle *rect);
|
||||
|
||||
void meta_surface_actor_set_input_region (MetaSurfaceActor *self,
|
||||
MtkRegion *region);
|
||||
void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
|
||||
|
Loading…
Reference in New Issue
Block a user