From 8f7d5fb2c0858f3928c5bff39879a54bf91409cc Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 26 May 2014 14:29:17 +0200 Subject: gesturerotate: Just return a double in get_angle_delta() Whether the gesture is active or recognized should be checked before in callers, or just not used naively. --- gtk/gtkgesturerotate.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'gtk/gtkgesturerotate.c') diff --git a/gtk/gtkgesturerotate.c b/gtk/gtkgesturerotate.c index ec8b12ae1c..8675125bb6 100644 --- a/gtk/gtkgesturerotate.c +++ b/gtk/gtkgesturerotate.c @@ -196,19 +196,16 @@ gtk_gesture_rotate_new (GtkWidget *widget) /** * gtk_gesture_rotate_get_angle_delta: * @gesture: a #GtkGestureRotate - * @delta: (out) (transfer none): angle delta * - * If @gesture is active, this function returns %TRUE and fills - * in @delta with the angle difference in radians since the - * gesture was first recognized. + * If @gesture is active, this function returns the angle difference + * in radians since the gesture was first recognized. * - * Returns: %TRUE if @controller is recognizing a rotate gesture + * Returns: the angle delta in radians * * Since: 3.14 **/ -gboolean -gtk_gesture_rotate_get_angle_delta (GtkGestureRotate *gesture, - gdouble *delta) +gdouble +gtk_gesture_rotate_get_angle_delta (GtkGestureRotate *gesture) { GtkGestureRotatePrivate *priv; gdouble angle; @@ -216,12 +213,9 @@ gtk_gesture_rotate_get_angle_delta (GtkGestureRotate *gesture, g_return_val_if_fail (GTK_IS_GESTURE_ROTATE (gesture), FALSE); if (!_gtk_gesture_rotate_get_angle (gesture, &angle)) - return FALSE; + return 0; priv = gtk_gesture_rotate_get_instance_private (gesture); - if (delta) - *delta = angle - priv->initial_angle; - - return TRUE; + return angle - priv->initial_angle; } -- cgit v1.2.1