translate method

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

Creates a new rectangle translated by the specified amounts.

dx The amount to translate in the x direction. dy The amount to translate in the y direction. Returns a new IntRect with translated coordinates.

Implementation

IntRect translate(final int dx, final int dy) {
  return IntRect(left + dx, top + dy, width, height);
}