blockly > BlockDragSurfaceSvg > translateSurface
BlockDragSurfaceSvg.translateSurface() method
Translate the entire drag surface during a drag. We translate the drag surface instead of the blocks inside the surface so that the browser avoids repainting the SVG. Because of this, the drag coordinates must be adjusted by scale.
Signature:
translateSurface(x: number, y: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
x | number | X translation for the entire surface. |
y | number | Y translation for the entire surface. |
Returns:
void