From f76f30fd6a69d866d31c9e7a62af241fac7e4176 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 8 Aug 2019 17:21:12 -0300 Subject: [PATCH] dnd: Fix drag cancel animation scale When a drag is cancelled and the source actor is visible, the drag actor is animated back to the source position. The scale that the drag actor will become is calculated as: scale = this._dragActor.width / sourceScaledWidth However, this is wrong; what we wanted to do is the opposite: scale = sourceScaledWidth / this._dragActor.width Fix the scale calculation to match the math above. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/671 --- js/ui/dnd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 6539443cd..786d65419 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -611,7 +611,7 @@ var _Draggable = class _Draggable { // Snap the clone back to its source [x, y] = this._dragActorSource.get_transformed_position(); let [sourceScaledWidth] = this._dragActorSource.get_transformed_size(); - scale = sourceScaledWidth ? this._dragActor.width / sourceScaledWidth : 0; + scale = sourceScaledWidth ? sourceScaledWidth / this._dragActor.width : 0; } else if (this._dragOrigParent) { // Snap the actor back to its original position within // its parent, adjusting for the fact that the parent