[gtk+/gtk-3-22] Fix off by one in check for GtkRoundedBox containing a rectangle
- From: Gustavo Noronha Silva <gns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] Fix off by one in check for GtkRoundedBox containing a rectangle
- Date: Mon, 21 Nov 2016 13:52:29 +0000 (UTC)
commit aa1307a787a9186119feb7c91fa755c852b69135
Author: Gustavo Noronha Silva <gustavo noronha collabora co uk>
Date: Thu Nov 17 15:15:50 2016 -0200
Fix off by one in check for GtkRoundedBox containing a rectangle
When checking if a rectangle is contained by the rounded box, the code
will refuse a rectangle which is the exact size as the one backing the
rounded box, since it checks for greater or equal width and height.
Check for greater only instead.
https://bugzilla.gnome.org/show_bug.cgi?id=774114
gtk/gtkroundedbox.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index 38443d7..ea1297f 100644
--- a/gtk/gtkroundedbox.c
+++ b/gtk/gtkroundedbox.c
@@ -722,8 +722,8 @@ _gtk_rounded_box_contains_rectangle (const GtkRoundedBox *box,
{
if (x1 < box->box.x ||
y1 < box->box.y ||
- x2 >= box->box.x + box->box.width ||
- y2 >= box->box.y + box->box.height)
+ x2 > box->box.x + box->box.width ||
+ y2 > box->box.y + box->box.height)
return FALSE;
if (x1 < box->box.x + box->corner[GTK_CSS_TOP_LEFT].horizontal &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]