From 9f8bd7a2bc54e850af0428006cc36d3e22ae2a2c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 26 May 2014 14:32:59 +0200 Subject: gesturezoom: Just return a double in get_scale_delta() Checking whether the gesture is active is a responsibility of the caller. --- gtk/gtkgesturezoom.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'gtk/gtkgesturezoom.c') diff --git a/gtk/gtkgesturezoom.c b/gtk/gtkgesturezoom.c index 75d6a76e4b..6fef52195b 100644 --- a/gtk/gtkgesturezoom.c +++ b/gtk/gtkgesturezoom.c @@ -191,17 +191,16 @@ gtk_gesture_zoom_new (GtkWidget *widget) * @gesture: a #GtkGestureZoom * @scale: (out) (transfer none): zoom delta * - * If @controller is active, this function returns %TRUE and fills - * in @scale with the zooming difference since the gesture was - * recognized (hence the starting point is considered 1:1). + * If @gesture is active, this function returns the zooming difference + * since the gesture was recognized (hence the starting point is + * considered 1:1). If @gesture is not active, 1 is returned. * * Returns: %TRUE if @controller is recognizing a zoom gesture * * Since: 3.14 **/ -gboolean -gtk_gesture_zoom_get_scale_delta (GtkGestureZoom *gesture, - gdouble *scale) +gdouble +gtk_gesture_zoom_get_scale_delta (GtkGestureZoom *gesture) { GtkGestureZoomPrivate *priv; gdouble distance; @@ -209,12 +208,9 @@ gtk_gesture_zoom_get_scale_delta (GtkGestureZoom *gesture, g_return_val_if_fail (GTK_IS_GESTURE_ZOOM (gesture), FALSE); if (!_gtk_gesture_zoom_get_distance (gesture, &distance)) - return FALSE; + return 1; priv = gtk_gesture_zoom_get_instance_private (gesture); - if (scale) - *scale = distance / priv->initial_distance; - - return TRUE; + return distance / priv->initial_distance; } -- cgit v1.2.1