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
This commit is contained in:
parent
914e5d30c7
commit
75f771d736
@ -461,12 +461,12 @@ _Draggable.prototype = {
|
|||||||
// its parent, adjusting for the fact that the parent
|
// its parent, adjusting for the fact that the parent
|
||||||
// may have been moved or scaled
|
// may have been moved or scaled
|
||||||
let [parentX, parentY] = this._dragOrigParent.get_transformed_position();
|
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 [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 = parentScaledWidth / parentWidth;
|
||||||
|
|
||||||
|
x = parentX + parentScale * this._dragOrigX;
|
||||||
|
y = parentY + parentScale * this._dragOrigY;
|
||||||
scale = this._dragOrigScale * parentScale;
|
scale = this._dragOrigScale * parentScale;
|
||||||
} else {
|
} else {
|
||||||
// Snap back actor to its original stage position
|
// Snap back actor to its original stage position
|
||||||
|
Loading…
Reference in New Issue
Block a user