blockly > BlockDragger > getNewLocationAfterDrag_

BlockDragger.getNewLocationAfterDrag_() 方法

計算拖曳區塊後的拖曳差異和新位置值。

Signature:

protected getNewLocationAfterDrag_(currentDragDeltaXY: Coordinate): {
        delta: Coordinate;
        newLocation: Coordinate;
    };

參數

參數 類型 說明
currentDragDeltaXY 座標 指標從拖曳開始算起的距離,以像素單位表示。

傳回:

{ 差異:座標;newLocation:Coordinate; }

拖曳後的新位置。差異遷移位於工作區單位。newLocation 是新的座標,代表區塊的最終位置。