[gnome-shell] dnd: Set the position and scale on the drag actor before it's reparented



commit 4fb33c9b09c160ee1cc12ebc481c673df401b35f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Apr 7 14:58:25 2013 -0400

    dnd: Set the position and scale on the drag actor before it's reparented
    
    We need to do this to ensure that it gets the correct scale, as otherwise
    the transform that we retrieve will be incorrect.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697504

 js/ui/dnd.js |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 1841f49..763bd04 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -291,19 +291,19 @@ const _Draggable = new Lang.Class({
             this._dragOrigY = this._dragActor.y;
             this._dragOrigScale = this._dragActor.scale_x;
 
-            this._dragActor.reparent(Main.uiGroup);
-            this._dragActor.raise_top();
-            Shell.util_set_hidden_from_pick(this._dragActor, true);
-
-            let [actorStageX, actorStageY] = this.actor.get_transformed_position();
-            this._dragOffsetX = actorStageX - this._dragStartX;
-            this._dragOffsetY = actorStageY - this._dragStartY;
-
             // Set the actor's scale such that it will keep the same
             // transformed size when it's reparented to the uiGroup
             let [scaledWidth, scaledHeight] = this.actor.get_transformed_size();
             this._dragActor.set_scale(scaledWidth / this.actor.width,
                                       scaledHeight / this.actor.height);
+
+            let [actorStageX, actorStageY] = this.actor.get_transformed_position();
+            this._dragOffsetX = actorStageX - this._dragStartX;
+            this._dragOffsetY = actorStageY - this._dragStartY;
+
+            this._dragActor.reparent(Main.uiGroup);
+            this._dragActor.raise_top();
+            Shell.util_set_hidden_from_pick(this._dragActor, true);
         }
 
         this._dragOrigOpacity = this._dragActor.opacity;


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