diff options
author | Timm Bäder <mail@baedert.org> | 2020-05-16 08:01:22 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-05-16 22:04:00 +0200 |
commit | 2e9d772e6670d5aabaccad7017e281c3505f2251 (patch) | |
tree | 0711d484e1a54766ed612b460431a66d1ec7ba94 /gtk/gtkdragicon.c | |
parent | bac6e79614f3f38f8877eb221aa275cf6875378a (diff) | |
download | gtk+-2e9d772e6670d5aabaccad7017e281c3505f2251.tar.gz |
natives: Use GtkCssBoxes in get_surface_transform
Diffstat (limited to 'gtk/gtkdragicon.c')
-rw-r--r-- | gtk/gtkdragicon.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gtk/gtkdragicon.c b/gtk/gtkdragicon.c index 45cb8e1c51..999ab113ca 100644 --- a/gtk/gtkdragicon.c +++ b/gtk/gtkdragicon.c @@ -27,6 +27,7 @@ #include "gtkcsstypesprivate.h" #include "gtknativeprivate.h" #include "gtkpicture.h" +#include "gtkcssboxesimplprivate.h" #include "gtkcssnumbervalueprivate.h" /* for the drag icons */ @@ -122,15 +123,14 @@ gtk_drag_icon_native_get_surface_transform (GtkNative *native, int *x, int *y) { - GtkCssStyle *style; - - style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (native))); - *x = _gtk_css_number_value_get (style->size->margin_left, 100) + - _gtk_css_number_value_get (style->border->border_left_width, 100) + - _gtk_css_number_value_get (style->size->padding_left, 100); - *y = _gtk_css_number_value_get (style->size->margin_top, 100) + - _gtk_css_number_value_get (style->border->border_top_width, 100) + - _gtk_css_number_value_get (style->size->padding_top, 100); + GtkCssBoxes css_boxes; + const graphene_rect_t *margin_rect; + + gtk_css_boxes_init (&css_boxes, GTK_WIDGET (native)); + margin_rect = gtk_css_boxes_get_margin_rect (&css_boxes); + + *x = - margin_rect->origin.x; + *y = - margin_rect->origin.y; } static void |