blockly > BlockDragger > getNewLocationAfterDrag_
BlockDragger.getNewLocationAfterDrag_() 方法
计算拖动块后的拖动增量和新的位置值。
Signature:
protected getNewLocationAfterDrag_(currentDragDeltaXY: Coordinate): {
delta: Coordinate;
newLocation: Coordinate;
};
参数
参数 | 类型 | 说明 |
---|---|---|
currentDragDeltaXY | 坐标 | 指针从拖动开始处移动的距离,以像素为单位。 |
返回:
{ delta: 坐标; newLocation: 坐标; }
拖动后的新位置。增量以工作区单位表示。newLocation 为块最终所在位置的新坐标。