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

Blockly.WorkspaceSvg

The workspace to drag.

Value must not be null.

Methods

dispose

dispose()

Sever all links from this object.

drag

drag(currentDragDeltaXY)

Move the workspace based on the most recent mouse movements.

Parameter

currentDragDeltaXY

goog.math.Coordinate

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

goog.math.Coordinate

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.