[gnome-shell] dnd: Avoid division by zero, etc for zero-size actors
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dnd: Avoid division by zero, etc for zero-size actors
- Date: Wed, 9 Mar 2011 12:56:54 +0000 (UTC)
commit 72120bb87fe34895cd52e3e17eb7f020ab6950a7
Author: Alexander Larsson <alexl redhat com>
Date: Fri Mar 4 14:21:17 2011 +0100
dnd: Avoid division by zero, etc for zero-size actors
When rescaling due to a possible parent actor resize avoid problems
if the parent width is zero.
https://bugzilla.gnome.org/show_bug.cgi?id=643786
js/ui/dnd.js | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index a755057..8751556 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -480,7 +480,9 @@ _Draggable.prototype = {
let [parentX, parentY] = this._dragOrigParent.get_transformed_position();
let [parentWidth, parentHeight] = this._dragOrigParent.get_size();
let [parentScaledWidth, parentScaledHeight] = this._dragOrigParent.get_transformed_size();
- let parentScale = parentScaledWidth / parentWidth;
+ let parentScale = 1.0;
+ if (parentWidth != 0)
+ parentScale = parentScaledWidth / parentWidth;
x = parentX + parentScale * this._dragOrigX;
y = parentY + parentScale * this._dragOrigY;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]