fixed: x/y passed to get_child_position are not optional

This commit is contained in:
Timm Bäder 2019-08-25 14:59:01 +02:00
parent 1db59d1c89
commit 31efc882db

View File

@ -183,8 +183,8 @@ gtk_fixed_put (GtkFixed *fixed,
void void
gtk_fixed_get_child_position (GtkFixed *fixed, gtk_fixed_get_child_position (GtkFixed *fixed,
GtkWidget *widget, GtkWidget *widget,
gint *x, int *x,
gint *y) int *y)
{ {
GtkFixedPrivate *priv = gtk_fixed_get_instance_private (fixed); GtkFixedPrivate *priv = gtk_fixed_get_instance_private (fixed);
GtkFixedLayoutChild *child_info; GtkFixedLayoutChild *child_info;
@ -193,15 +193,15 @@ gtk_fixed_get_child_position (GtkFixed *fixed,
g_return_if_fail (GTK_IS_FIXED (fixed)); g_return_if_fail (GTK_IS_FIXED (fixed));
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (x != NULL);
g_return_if_fail (y != NULL);
g_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (fixed)); g_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (fixed));
child_info = GTK_FIXED_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout, widget)); child_info = GTK_FIXED_LAYOUT_CHILD (gtk_layout_manager_get_layout_child (priv->layout, widget));
transform = gtk_fixed_layout_child_get_transform (child_info); transform = gtk_fixed_layout_child_get_transform (child_info);
gsk_transform_to_translate (transform, &pos_x, &pos_y); gsk_transform_to_translate (transform, &pos_x, &pos_y);
if (x != NULL)
*x = floorf (pos_x); *x = floorf (pos_x);
if (y != NULL)
*y = floorf (pos_y); *y = floorf (pos_y);
} }