[clutter] drag-action: fix press coords transform with drag_handle



commit 59801ef854016cc85c6bcf8b6ed8a77081f433fb
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Fri Aug 10 20:47:46 2012 +0200

    drag-action: fix press coords transform with drag_handle
    
    When setting a drag handle, transform the original press
    coordinates using the drag handle as reference instead of the
    associated actor.
    
    This causes the initial misplacement of drag handle in
    example/drag-action when holding down the Shift key: the handle
    gets placed at the main actor origin on the first drag event,
    instead of following the mouse pointer.
    
    All subsequent motion events already use the right actor when
    transforming the coordinates, thus they are not affected.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681746

 clutter/clutter-drag-action.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-drag-action.c b/clutter/clutter-drag-action.c
index a58ec4d..a9aaa49 100644
--- a/clutter/clutter-drag-action.c
+++ b/clutter/clutter-drag-action.c
@@ -1106,6 +1106,12 @@ clutter_drag_action_set_drag_handle (ClutterDragAction *action,
 
   priv->drag_handle = handle;
 
+  priv->transformed_press_x = priv->press_x;
+  priv->transformed_press_y = priv->press_y;
+  clutter_actor_transform_stage_point (handle, priv->press_x, priv->press_y,
+                                       &priv->transformed_press_x,
+                                       &priv->transformed_press_y);
+
   if (priv->drag_handle != NULL)
     g_signal_connect (priv->drag_handle, "destroy",
                       G_CALLBACK (on_drag_handle_destroy),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]