summaryrefslogtreecommitdiff
path: root/gtk/gtkgesturezoom.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-05-26 14:32:59 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-05-27 17:47:12 +0200
commit9f8bd7a2bc54e850af0428006cc36d3e22ae2a2c (patch)
treefbe8f45580d61afa2590893f0580213a7130c814 /gtk/gtkgesturezoom.c
parent8f7d5fb2c0858f3928c5bff39879a54bf91409cc (diff)
downloadgtk+-9f8bd7a2bc54e850af0428006cc36d3e22ae2a2c.tar.gz
gesturezoom: Just return a double in get_scale_delta()
Checking whether the gesture is active is a responsibility of the caller.
Diffstat (limited to 'gtk/gtkgesturezoom.c')
-rw-r--r--gtk/gtkgesturezoom.c18
1 files changed, 7 insertions, 11 deletions
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;
}