mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 11:00:54 -05:00
shaped-texture: Use G_APPROX_VALUE to compare viewport source rects
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1799>
This commit is contained in:
parent
1bfd932f15
commit
50ba52b1b5
@ -1264,10 +1264,14 @@ meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex,
|
||||
graphene_rect_t *src_rect)
|
||||
{
|
||||
if (!stex->has_viewport_src_rect ||
|
||||
stex->viewport_src_rect.origin.x != src_rect->origin.x ||
|
||||
stex->viewport_src_rect.origin.y != src_rect->origin.y ||
|
||||
stex->viewport_src_rect.size.width != src_rect->size.width ||
|
||||
stex->viewport_src_rect.size.height != src_rect->size.height)
|
||||
!G_APPROX_VALUE (stex->viewport_src_rect.origin.x,
|
||||
src_rect->origin.x, FLT_EPSILON) ||
|
||||
!G_APPROX_VALUE (stex->viewport_src_rect.origin.y,
|
||||
src_rect->origin.y, FLT_EPSILON) ||
|
||||
!G_APPROX_VALUE (stex->viewport_src_rect.size.width,
|
||||
src_rect->size.width, FLT_EPSILON) ||
|
||||
!G_APPROX_VALUE (stex->viewport_src_rect.size.height,
|
||||
src_rect->size.height, FLT_EPSILON))
|
||||
{
|
||||
stex->has_viewport_src_rect = TRUE;
|
||||
stex->viewport_src_rect = *src_rect;
|
||||
|
Loading…
Reference in New Issue
Block a user