Look at current mouse position for dropping
Previously we used the top-left corner which was not intuitive, particularly when dragging partially opaque actors. https://bugzilla.gnome.org/show_bug.cgi?id=607821
This commit is contained in:
parent
3333f30c42
commit
765779272f
@ -220,8 +220,7 @@ _Draggable.prototype = {
|
|||||||
// we have to temporarily hide this._dragActor.
|
// we have to temporarily hide this._dragActor.
|
||||||
this._dragActor.hide();
|
this._dragActor.hide();
|
||||||
let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL,
|
let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL,
|
||||||
stageX + this._dragOffsetX,
|
stageX, stageY);
|
||||||
stageY + this._dragOffsetY);
|
|
||||||
this._dragActor.show();
|
this._dragActor.show();
|
||||||
while (target) {
|
while (target) {
|
||||||
if (target._delegate && target._delegate.handleDragOver) {
|
if (target._delegate && target._delegate.handleDragOver) {
|
||||||
@ -230,8 +229,8 @@ _Draggable.prototype = {
|
|||||||
// We can check the return value of the function and break the loop if it's true if we don't want
|
// We can check the return value of the function and break the loop if it's true if we don't want
|
||||||
// to continue checking the parents.
|
// to continue checking the parents.
|
||||||
target._delegate.handleDragOver(this.actor._delegate, this._dragActor,
|
target._delegate.handleDragOver(this.actor._delegate, this._dragActor,
|
||||||
(stageX + this._dragOffsetX - targX) / target.scale_x,
|
(stageX - targX) / target.scale_x,
|
||||||
(stageY + this._dragOffsetY - targY) / target.scale_y,
|
(stageY - targY) / target.scale_y,
|
||||||
event.get_time());
|
event.get_time());
|
||||||
}
|
}
|
||||||
target = target.get_parent();
|
target = target.get_parent();
|
||||||
|
Loading…
Reference in New Issue
Block a user