[gtk/pick-insensitive2: 1/9] widget: Make contains respect rounded borders



commit dce2c58799770490022990015f84ab8c7e1f79f1
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 7 15:11:22 2019 +0000

    widget: Make contains respect rounded borders
    
    We have the api for this now.

 gtk/gtkwidget.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ed0a21f5a7..e118af5852 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -824,9 +824,8 @@ gtk_widget_real_contains (GtkWidget *widget,
 
   gtk_css_boxes_init (&boxes, widget);
 
-  /* XXX: This misses rounded rects */
-  return graphene_rect_contains_point (gtk_css_boxes_get_border_rect (&boxes),
-                                       &(graphene_point_t){x, y});
+  return gsk_rounded_rect_contains_point (gtk_css_boxes_get_border_box (&boxes),
+                                          &GRAPHENE_POINT_INIT (x, y));
 }
 
 static GtkWidget *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]