diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2015-10-31 16:58:35 +0100 |
---|---|---|
committer | Jiří Techet <techet@gmail.com> | 2015-11-16 23:56:14 +0100 |
commit | 5cb2cb3c40fc3139781279cd0c94d26da3a07daf (patch) | |
tree | 5d89e11f7ab973bb45f1cfe6c782bba2ccab7607 | |
parent | d115060c179a4894f0f257c606d473740b0d2961 (diff) | |
download | libchamplain-5cb2cb3c40fc3139781279cd0c94d26da3a07daf.tar.gz |
view: Stop emission of ClutterZoomAction::gesture-cancelled
We successfully override ::gesture-begin and ::zoom in order to
replace the default "zoom the actor" behavior of ClutterZoomAction,
however ClutterZoomAction::gesture-cancel implementation has the side
effect of attempting to restore the actor translation and scale to the
original position, which is undesirable here.
This fixes the ChamplainView going blank, as it tries to "restore" a
0 scale, because we didn't give it an opportunity to fetch the actor
one on ClutterZoomAction::gesture-begin.
https://bugzilla.gnome.org/show_bug.cgi?id=757149
-rw-r--r-- | champlain/champlain-view.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index 4e5480c..85ea530 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -1252,6 +1252,18 @@ zoom_gesture_finish_cb (ClutterGestureAction *gesture, static void +zoom_gesture_cancel_cb (ClutterGestureAction *gesture, + G_GNUC_UNUSED ClutterActor *actor, + gpointer user_data) +{ + ChamplainViewPrivate *priv = GET_PRIVATE (user_data); + + priv->zoom_started = FALSE; + g_signal_stop_emission_by_name (gesture, "gesture-cancel"); +} + + +static void champlain_view_init (ChamplainView *view) { DEBUG_LOG () @@ -1358,7 +1370,7 @@ champlain_view_init (ChamplainView *view) g_signal_connect (priv->zoom_gesture, "gesture-end", G_CALLBACK (zoom_gesture_finish_cb), view); g_signal_connect (priv->zoom_gesture, "gesture-cancel", - G_CALLBACK (zoom_gesture_finish_cb), view); + G_CALLBACK (zoom_gesture_cancel_cb), view); clutter_actor_add_action (CLUTTER_ACTOR (view), CLUTTER_ACTION (priv->zoom_gesture)); |