translate method

Rect translate(
  1. Coordinate tx
)

Translates this rectangle by the given offsets. If a {@code goog.math.Coordinate} is given, then the left and top values are translated by the coordinate's x and y values. Otherwise, top and left are translated by {@code tx} and {@code opt_ty} respectively. @param {number|goog.math.Coordinate} tx The value to translate left by or the the coordinate to translate this rect by. @param {number=} opt_ty The value to translate top by. @return {!goog.math.Rect} This rectangle after translating.

Implementation

Rect translate(Coordinate tx)
{
  left += tx.x;
  top += tx.y;
  return this;
}