translate method

IntOffset translate(
  1. int dx,
  2. int dy
)

Creates a new IntOffset translated by the given amounts.

  • x - The amount to translate in the x direction
  • dy - The amount to translate in the y direction

Returns a new offset with coordinates shifted by the given amounts.

Implementation

IntOffset translate(int dx, int dy) => IntOffset(x + dx, y + dy);