snapToGrid method

Point snapToGrid(
  1. num originx,
  2. num originy,
  3. num cellwidth,
  4. num cellheight,
)

Modify this point to be at the nearest point on an infinite grid, given the grid's origin and size of each grid cell. @param {number} originx the top-left point of one of the grid cells @param {number} originy the top-left point of one of the grid cells @param {number} cellwidth the size of each grid cell -- must be a real number larger than zero @param {number} cellheight the size of each grid cell -- must be a real number larger than zero @return {Point} this modified Point @since 1.3

Implementation

_i3.Point snapToGrid(
  _i2.num originx,
  _i2.num originy,
  _i2.num cellwidth,
  _i2.num cellheight,
) =>
    _i4.callMethod(
      this,
      'snapToGrid',
      [
        originx,
        originy,
        cellwidth,
        cellheight,
      ],
    );