blockly > BlockDragger > getNewLocationAfterDrag_

Metode BlockDragger.getNewLocationAfterDrag_()

Menghitung delta seret dan nilai lokasi baru setelah blok ditarik.

Tanda Tangan:

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

Parameter

Parameter Jenis Deskripsi
currentDragDeltaXY Koordinat Seberapa jauh pointer telah bergerak dari awal tarik, dalam satuan piksel.

Hasil:

{ delta: Koordinat; newLocation: Koordinat; }

Lokasi baru setelah ditarik. delta berada di unit ruang kerja. newLocation adalah koordinat baru tempat seharusnya blok berada.