Blockly. WorkspaceDragger
Constructor
WorkspaceDragger
new WorkspaceDragger(workspace)
Class for a workspace dragger. It moves the workspace around when it is being dragged by a mouse or touch. Note that the workspace itself manages whether or not it has a drag surface and how to do translations based on that. This simply passes the right commands based on events.
Parameter |
|
---|---|
workspace |
The workspace to drag. Value must not be null. |
Property
startScrollXY_
non-null Blockly.utils.Coordinate
The scroll position of the workspace at the beginning of the drag. Coordinate system: pixel coordinates.
Methods
dispose
dispose()
Sever all links from this object.
drag
drag(currentDragDeltaXY)
Move the workspace based on the most recent mouse movements.
Parameter |
|
---|---|
currentDragDeltaXY |
How far the pointer has moved from the position at the start of the drag, in pixel coordinates. Value must not be null. |
endDrag
endDrag(currentDragDeltaXY)
Finish dragging the workspace and put everything back where it belongs.
Parameter |
|
---|---|
currentDragDeltaXY |
How far the pointer has moved from the position at the start of the drag, in pixel coordinates. Value must not be null. |
startDrag
startDrag()
Start dragging the workspace.