1. #1
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    41
    Vote Rating
    0
    Powderhound is on a distinguished road

      0  

    Default Draggable, region & offset issue

    Draggable, region & offset issue


    I have Panel with a Draggable and a Droppable Object placed in it. When I first move the Draggable, I successfully get a dropenter event from the Droppable when the Draggable intersects.

    However, if I move the Draggable to a place on the Panel, and let go of the mouse button, any subsequent intersections do not occur in the correct location. They are offset by a vector representing the movement of the Draggable from it's initial position to where it was first moved.

    In reading through the source code, it appears that Draggable.region and Droppable.region are used in determining when to fire the dropenter event. I have tracked Draggable.region.top and Draggable.region.left as the Draggable is moved. They appear fine while the Draggable is first being moved and when it is first relocated in the Panel. However, when the the Draggable is moved again, it's region.left and region.top values appear to be added to the Draggable.offset.x and Draggable.offest.y values as they were before the Draggable was moved for the second time. This makes the Draggable's intersection region offset in relation to the Droppable's, and explains why the intersection occurs in the wrong place.

    My question is why are the offset values being added to the region values?

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    41
    Vote Rating
    0
    Powderhound is on a distinguished road

      0  

    Default


    OK, I'm thinking this is actually a bug.

    If I take the dragdrop example code, and change revert to false for the Draggable, I get exactly the same behavior. Once the Draggable is relocated, it no longer intersects with the Droppable at the same location. Exactly the same issue is happening - the offset is getting added to the region co-ordinates.

    Can anyone explain this?

    Thanks

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    7
    Vote Rating
    0
    bk.dbe is on a distinguished road

      0  

    Default


    Hello Powderhound,

    Is this bug related to this other one you had reported ? : http://www.sencha.com/forum/showthread.php?142369-Draggable-revert-false-prevents-intersections-working&p=650393

    I
    re-bumped it, your fix works well. Thanks for this ! Hope Sencha Team will fix it too.

  4. #4
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    41
    Vote Rating
    0
    Powderhound is on a distinguished road

      0  

    Default


    Yes, it is. Thanks for the bump. Unfortunately Sencha doesn't seem to be listening to most of the bug reports, which is very frustrating...

Thread Participants: 1