[gnome-shell] dnd: Prevent dividing by zero when calculating the scale factor
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dnd: Prevent dividing by zero when calculating the scale factor
- Date: Fri, 22 Sep 2017 14:50:31 +0000 (UTC)
commit 703187e99620de085978954fe3a3004676de1046
Author: Mario Sanchez Prada <mario endlessm com>
Date: Fri Jun 30 01:22:42 2017 +0000
dnd: Prevent dividing by zero when calculating the scale factor
This ensures that we snap back to the correct size when the
source actor has been scaled to 0.
https://bugzilla.gnome.org/show_bug.cgi?id=787901
js/ui/dnd.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 64c1eb5..a64915b 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -531,7 +531,7 @@ var _Draggable = new Lang.Class({
// Snap the clone back to its source
[x, y] = this._dragActorSource.get_transformed_position();
let [sourceScaledWidth, sourceScaledHeight] = this._dragActorSource.get_transformed_size();
- scale = this._dragActor.width / sourceScaledWidth;
+ scale = sourceScaledWidth ? this._dragActor.width / sourceScaledWidth : 0;
} else if (this._dragOrigParent) {
// Snap the actor back to its original position within
// its parent, adjusting for the fact that the parent
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]