[gtk+/wip/cosimoc/range-gadget] gadget: simplify code
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cosimoc/range-gadget] gadget: simplify code
- Date: Wed, 24 Feb 2016 23:52:01 +0000 (UTC)
commit e5d9ed53ec1799038f7e283c0b4e5ebc1d1dc2f5
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Feb 24 15:51:40 2016 -0800
gadget: simplify code
gtk/gtkcssgadget.c | 40 +++++++++++++++-------------------------
1 files changed, 15 insertions(+), 25 deletions(-)
---
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index 6ba827a..89a0f68 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -528,12 +528,9 @@ gtk_css_gadget_margin_box_contains_point (GtkCssGadget *gadget,
int x,
int y)
{
- GtkAllocation margin_allocation;
-
- gtk_css_gadget_get_margin_allocation (gadget, &margin_allocation, NULL);
- shift_allocation (gadget, &margin_allocation);
-
- return allocation_contains_point (&margin_allocation, x, y);
+ GtkAllocation margin_box;
+ gtk_css_gadget_get_margin_box (gadget, &margin_box);
+ return allocation_contains_point (&margin_box, x, y);
}
/**
@@ -554,12 +551,9 @@ gtk_css_gadget_border_box_contains_point (GtkCssGadget *gadget,
int x,
int y)
{
- GtkAllocation border_allocation;
-
- gtk_css_gadget_get_border_allocation (gadget, &border_allocation, NULL);
- shift_allocation (gadget, &border_allocation);
-
- return allocation_contains_point (&border_allocation, x, y);
+ GtkAllocation border_box;
+ gtk_css_gadget_get_border_box (gadget, &border_box);
+ return allocation_contains_point (&border_box, x, y);
}
/**
@@ -580,12 +574,9 @@ gtk_css_gadget_content_box_contains_point (GtkCssGadget *gadget,
int x,
int y)
{
- GtkAllocation content_allocation;
-
- gtk_css_gadget_get_content_allocation (gadget, &content_allocation, NULL);
- shift_allocation (gadget, &content_allocation);
-
- return allocation_contains_point (&content_allocation, x, y);
+ GtkAllocation content_box;
+ gtk_css_gadget_get_content_box (gadget, &content_box);
+ return allocation_contains_point (&content_box, x, y);
}
/**
@@ -817,18 +808,17 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
GtkCssStyle *style;
int x, y, width, height;
int contents_x, contents_y, contents_width, contents_height;
- GtkAllocation margin_allocation;
+ GtkAllocation margin_box;
if (!gtk_css_gadget_get_visible (gadget))
return;
- gtk_css_gadget_get_margin_allocation (gadget, &margin_allocation, NULL);
- shift_allocation (gadget, &margin_allocation);
+ gtk_css_gadget_get_margin_box (gadget, &margin_box);
- x = margin_allocation.x;
- y = margin_allocation.y;
- width = margin_allocation.width;
- height = margin_allocation.height;
+ x = margin_box.x;
+ y = margin_box.y;
+ width = margin_box.width;
+ height = margin_box.height;
style = gtk_css_gadget_get_style (gadget);
get_box_margin (style, &margin);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]