boxes: Add function to create a rectangle from floating clutter rect

Meta rectangles are integer based while clutter works in floating coordinates,
so when converting to integers we need a strategy.

Implement the shrink strategy by ceiling the coordinates and flooring the width,
and the grow strategy reusing clutter facility for this.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
This commit is contained in:
Marco Trevisan (Treviño)
2019-03-01 14:23:05 +01:00
parent 9d9d455bba
commit a8c972cd6b
2 changed files with 37 additions and 0 deletions

View File

@ -274,6 +274,10 @@ void meta_rectangle_transform (const MetaRectangle *rect,
int height,
MetaRectangle *dest);
void meta_rectangle_from_clutter_rect (ClutterRect *rect,
MetaRoundingStrategy rounding_strategy,
MetaRectangle *dest);
void meta_rectangle_crop_and_scale (const MetaRectangle *rect,
ClutterRect *src_rect,
int dst_width,