mirror of
https://github.com/brl/mutter.git
synced 2025-03-06 05:08:11 +00:00
boxes: Add 'round' rounding strategy
It just calls roundf(), and is intended to be used when the graphene rectangle is approximately integer aligned. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
This commit is contained in:
parent
7f6cafa847
commit
a11f9bd513
@ -45,6 +45,7 @@ typedef enum _MetaRoundingStrategy
|
|||||||
{
|
{
|
||||||
META_ROUNDING_STRATEGY_SHRINK,
|
META_ROUNDING_STRATEGY_SHRINK,
|
||||||
META_ROUNDING_STRATEGY_GROW,
|
META_ROUNDING_STRATEGY_GROW,
|
||||||
|
META_ROUNDING_STRATEGY_ROUND,
|
||||||
} MetaRoundingStrategy;
|
} MetaRoundingStrategy;
|
||||||
|
|
||||||
/* Output functions -- note that the output buffer had better be big enough:
|
/* Output functions -- note that the output buffer had better be big enough:
|
||||||
|
@ -2151,6 +2151,15 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
break;
|
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),
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user