Function toIntegerValues

Returns a point with rounded x,y coordinates. By default uses Math.round to round.

toIntegerValues({x:1.234, y:5.567}); // Yields: {x:1, y:6}
toIntegerValues(pt, Math.ceil); // Use Math.ceil to round x,y of `pt`.
  • Parameters

    • pt: Point

      Point to round

    • rounder: ((x: number) => number) = Math.round

      Rounding function, or Math.round by default

        • (x): number
        • Parameters

          • x: number

          Returns number

    Returns Point