Ensure our drag actor is positioned over the cursor

Previously we were looking at the source size, which is
not necessarily the same as the drag actor size.

https://bugzilla.gnome.org/show_bug.cgi?id=607821
This commit is contained in:
Colin Walters 2010-03-09 19:15:43 -05:00
parent 087ac8470e
commit 7d8c3f1ecd

View File

@ -154,10 +154,9 @@ _Draggable.prototype = {
// the dragActor over it. Otherwise, center it // the dragActor over it. Otherwise, center it
// around the pointer // around the pointer
let [sourceX, sourceY] = this._dragActorSource.get_transformed_position(); let [sourceX, sourceY] = this._dragActorSource.get_transformed_position();
let [sourceWidth, sourceHeight] = this._dragActorSource.get_transformed_size();
let x, y; let x, y;
if (stageX > sourceX && stageX <= sourceX + sourceWidth && if (stageX > sourceX && stageX <= sourceX + this._dragActor.width &&
stageY > sourceY && stageY <= sourceY + sourceHeight) { stageY > sourceY && stageY <= sourceY + this._dragActor.height) {
x = sourceX; x = sourceX;
y = sourceY; y = sourceY;
} else { } else {