blockly > dragging > Dragger

dragging.Dragger 类

Signature:

export declare class Dragger implements IDragger 

实现IDragger

构造函数

构造函数 修饰符 说明
(constructor)(draggable, workspace) 构造 Dragger 类的新实例

属性

属性 修饰符 类型 说明
draggable protected IDraggable
dragTarget protected IDragTarget | null
startLoc protected 坐标
工作区 protected WorkspaceSvg

方法

方法 修饰符 说明
onDrag(e, totalDelta) 用于计算元素应实际移动到的位置。
onDragEnd(e) 处理任何拖动清理。
onDragStart(e) 处理任何拖动启动。
pixelsToWorkspaceUnits(pixelCoord) protected
shouldReturnToStart(e, rootDraggable) protected 如果我们应在拖动结束时将可拖动对象返回到其原始位置,则返回 true。
updateDragTarget(e) protected 更新指针下的拖动目标(如果有)。
wouldDeleteDraggable(e, rootDraggable) protected 如果我们会在当前位置删除可拖放对象,则返回 true。