Skip to main content

Function: snapStamp()

snapStamp(x, y, params): object

Defined in: src/lib/brushes/params/index.ts:269

Move a stamp onto whole pixels (see snapToPixelGrid). Its offset is included in the returned point, so the returned params have no offset.

Parameters​

x​

number

y​

number

params​

StampParams

Returns​

object

params​

params: StampParams

x​

x: number

y​

y: number

Example​

snapStamp(10.7, 4.2, { width: 1, height: 1, rotation: 0, offsetX: 2, offsetY: 0, alpha: 1 });
// { x: 12.5, y: 4.5, params: { width: 1, height: 1, rotation: 0, offsetX: 0, offsetY: 0, alpha: 1 } }