[gtk/wip/otte/no-clip-on-draw: 2/9] roundedrect: Fix inlining of graphene functions
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/no-clip-on-draw: 2/9] roundedrect: Fix inlining of graphene functions
- Date: Thu, 13 Feb 2020 06:38:29 +0000 (UTC)
commit 77d7c713d4be60ec45a78668b6667aa24b5c6eb5
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 13 07:33:18 2020 +0100
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.
gsk/gskroundedrect.c | 8 ++++----
1 file 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) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]