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
This commit is contained in:
parent
7eaca86bf1
commit
72120bb87f
@ -480,7 +480,9 @@ _Draggable.prototype = {
|
|||||||
let [parentX, parentY] = this._dragOrigParent.get_transformed_position();
|
let [parentX, parentY] = this._dragOrigParent.get_transformed_position();
|
||||||
let [parentWidth, parentHeight] = this._dragOrigParent.get_size();
|
let [parentWidth, parentHeight] = this._dragOrigParent.get_size();
|
||||||
let [parentScaledWidth, parentScaledHeight] = this._dragOrigParent.get_transformed_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;
|
x = parentX + parentScale * this._dragOrigX;
|
||||||
y = parentY + parentScale * this._dragOrigY;
|
y = parentY + parentScale * this._dragOrigY;
|
||||||
|
Loading…
Reference in New Issue
Block a user