Constructor

BubbleDragger

new BubbleDragger(bubble, workspace)

Class for a bubble dragger. It moves things on the bubble canvas around the workspace when they are being dragged by a mouse or touch. These can be block comments, mutators, warnings, or workspace comments.

Parameter

bubble

(non-null Blockly.Bubble or non-null Blockly.WorkspaceCommentSvg)

The item on the bubble canvas to drag.

workspace

Blockly.WorkspaceSvg

The workspace to drag on.

Value must not be null.

Methods

dispose

dispose()

Sever all links from this object.

dragBubble

dragBubble(e, currentDragDeltaXY)

Execute a step of bubble dragging, based on the given event. Update the display accordingly.

Parameter

e

Event

The most recent move event.

Value must not be null.

currentDragDeltaXY

goog.math.Coordinate

How far the pointer has moved from the position at the start of the drag, in pixel units.

Value must not be null.

endBubbleDrag

endBubbleDrag(e, currentDragDeltaXY)

Finish a bubble drag and put the bubble back on the workspace.

Parameter

e

Event

The mouseup/touchend event.

Value must not be null.

currentDragDeltaXY

goog.math.Coordinate

How far the pointer has moved from the position at the start of the drag, in pixel units.

Value must not be null.

startBubbleDrag

startBubbleDrag()

Start dragging a bubble. This includes moving it to the drag surface.