mfremont-smith
3 years agoOccasional Contributor
tristaanogre - I like this idea. As a workaround, if you do an explicit scrollIntoView before calculating the coordinates for the start and destination objects, you should be good. The fn below works for me.
DragAndDrop(dragObject, droppableObject) {
//Wait for drag and drop objects to be enabled
dragObject.WaitProperty("Enabled", true);
droppableObject.WaitProperty("Enabled", true);
//Scroll dragObject into view before coordinates are calculated
dragObject.scrollIntoView(true);
let dragX = dragObject.Width/2;
let dragY = dragObject.Height/2;
let dragObjectLeft = dragObject.Left;
let dragObjectTop = dragObject.Top;
//Scroll droppableObject into view before coordinates are calculated
droppableObject.scrollIntoView(true);
let dropX = droppableObject.Left - dragObjectLeft + droppableObject.Width/2;
let dropY = droppableObject.Top - dragObjectTop + droppableObject.Height/2;
dragObject.Drag(dragX, dragY, dropX, dropY);
}
Related Content
- 11 years ago
- 5 years ago