[gnome-shell] dnd: Fix bug in computation of snap-back position



commit 75f771d73646842494d874cc4c087f71c4cacc21
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Fri Feb 11 12:19:12 2011 -0500

    dnd: Fix bug in computation of snap-back position
    
    We were properly accounting for the fact that an ancestor of the
    parent could be scaled rather than the parent itself when computing
    the snap-back scale, but directly using parent.scale_x for the
    snap-back location.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=642117

 js/ui/dnd.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 7c88dc2..021cb2e 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -461,12 +461,12 @@ _Draggable.prototype = {
             // its parent, adjusting for the fact that the parent
             // may have been moved or scaled
             let [parentX, parentY] = this._dragOrigParent.get_transformed_position();
-            x = parentX + this._dragOrigParent.scale_x * this._dragOrigX;
-            y = parentY + this._dragOrigParent.scale_y * this._dragOrigY;
-
             let [parentWidth, parentHeight] = this._dragOrigParent.get_size();
             let [parentScaledWidth, parentScaledHeight] = this._dragOrigParent.get_transformed_size();
             let parentScale = parentScaledWidth / parentWidth;
+
+            x = parentX + parentScale * this._dragOrigX;
+            y = parentY + parentScale * this._dragOrigY;
             scale = this._dragOrigScale * parentScale;
         } else {
             // Snap back actor to its original stage position



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