full-journalist-82607
09/08/2022, 3:06 PM/**
* A Rect specifying the bounds in the screen's coordinate space.
* Default: screen's bounds
*/
@:optional var dragBounds:Rectangle;
But in fact its the rectangle compared to the x, y of the dragged component, which is not very instinctive. ( Because it's not easy to calculate when a component position isn't calculated yet)best-agent-85158
09/08/2022, 3:22 PMbright-gpu-74537
09/08/2022, 3:23 PMbright-gpu-74537
09/08/2022, 3:23 PMfull-journalist-82607
09/08/2022, 3:31 PMbright-gpu-74537
09/08/2022, 3:32 PMbright-gpu-74537
09/08/2022, 3:33 PMbright-gpu-74537
09/08/2022, 3:33 PMbright-gpu-74537
09/08/2022, 3:34 PMbright-gpu-74537
09/08/2022, 3:35 PMbright-gpu-74537
09/08/2022, 3:39 PMfull-journalist-82607
09/08/2022, 3:45 PMbright-gpu-74537
09/08/2022, 3:46 PMfull-journalist-82607
09/08/2022, 3:48 PMbright-gpu-74537
09/08/2022, 3:48 PMfull-journalist-82607
09/08/2022, 3:59 PMbright-gpu-74537
09/08/2022, 4:00 PMbright-gpu-74537
09/08/2022, 4:01 PMbright-gpu-74537
09/08/2022, 4:02 PMbright-gpu-74537
09/08/2022, 4:03 PMbright-gpu-74537
09/08/2022, 4:05 PMfull-journalist-82607
09/08/2022, 4:12 PMfull-journalist-82607
09/08/2022, 4:21 PMvar originBox = objects[line][column];
> component.registerEvent(MouseEvent.MOUSE_DOWN, function(e) {
> if (component.draggable) {
> if (component.parentComponent != null)
> Utils.changeParentContainer(component, this);
> this.lockLayout();
> }
> }, 9999);
Here is part of the code for the behaviour in the grid. The instereseting part , is the MOUSE_DOWN, which I highly prioritises the change the parent component. The changeParentContainer just change the parent container, and sets the x an y at the correct position .icy-zebra-52882
09/09/2022, 8:12 AMbright-gpu-74537
09/09/2022, 8:37 AMrefined-laptop-39041
09/10/2022, 10:46 PMambitious-knife-25690
09/10/2022, 11:05 PMrefined-laptop-39041
09/10/2022, 11:24 PMambitious-knife-25690
09/10/2022, 11:26 PM