diff --git a/src/core/boxes-private.h b/src/core/boxes-private.h index e1a72d335..152be6e49 100644 --- a/src/core/boxes-private.h +++ b/src/core/boxes-private.h @@ -45,6 +45,7 @@ typedef enum _MetaRoundingStrategy { META_ROUNDING_STRATEGY_SHRINK, META_ROUNDING_STRATEGY_GROW, + META_ROUNDING_STRATEGY_ROUND, } MetaRoundingStrategy; /* Output functions -- note that the output buffer had better be big enough: diff --git a/src/core/boxes.c b/src/core/boxes.c index 6b7b0bbaf..d1f81975f 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -2151,6 +2151,15 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect, }; } break; + case META_ROUNDING_STRATEGY_ROUND: + { + *dest = (MetaRectangle) { + .x = roundf (rect->origin.x), + .y = roundf (rect->origin.y), + .width = roundf (rect->size.width), + .height = roundf (rect->size.height), + }; + } } }