summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-02-13 07:33:18 +0100
committerBenjamin Otte <otte@redhat.com>2020-02-13 07:36:38 +0100
commit77d7c713d4be60ec45a78668b6667aa24b5c6eb5 (patch)
treea1d9c99b8b9ab20150a2a389e9d8301c71cb8b6d
parentb0369fc3008b69a37f239ff1788a1b1b00403e65 (diff)
downloadgtk+-77d7c713d4be60ec45a78668b6667aa24b5c6eb5.tar.gz
roundedrect: Fix inlining of graphene functions
graphene treats equality for contains() operations as always matching, so do the same thing. This is because unlike integer math, floating point cannot do the "as close as possible to the point, but not reaching it" operation that integer does by just subtracting 1.
-rw-r--r--gsk/gskroundedrect.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gsk/gskroundedrect.c b/gsk/gskroundedrect.c
index 2e01589639..4d95d52666 100644
--- a/gsk/gskroundedrect.c
+++ b/gsk/gskroundedrect.c
@@ -340,8 +340,8 @@ gsk_rounded_rect_locate_point (const GskRoundedRect *self,
{
if (point->x < self->bounds.origin.x ||
point->y < self->bounds.origin.y ||
- point->x >= self->bounds.origin.x + self->bounds.size.width ||
- point->y >= self->bounds.origin.y + self->bounds.size.height)
+ point->x > self->bounds.origin.x + self->bounds.size.width ||
+ point->y > self->bounds.origin.y + self->bounds.size.height)
return OUTSIDE;
if (self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width > point->x &&
@@ -417,8 +417,8 @@ gsk_rounded_rect_contains_rect (const GskRoundedRect *self,
{
if (rect->origin.x < self->bounds.origin.x ||
rect->origin.y < self->bounds.origin.y ||
- rect->origin.x + rect->size.width >= self->bounds.origin.x + self->bounds.size.width ||
- rect->origin.y + rect->size.height >= self->bounds.origin.y + self->bounds.size.height)
+ rect->origin.x + rect->size.width > self->bounds.origin.x + self->bounds.size.width ||
+ rect->origin.y + rect->size.height > self->bounds.origin.y + self->bounds.size.height)
return FALSE;
if (!gsk_rounded_rect_contains_point (self, &rect->origin) ||