src/main/java/chalmers/pimp/model/viewport/Viewport.java
void center(int areaWidth, int areaHeight) {
    if ((areaWidth < 1) || (areaHeight < 1)) {
      String msg = "Bad area dimensions: (" + areaWidth + "x" + areaHeight + ")";
      throw new IllegalArgumentException(msg);
    }

    int x = -(areaWidth - width) / 2;
    int y = -(areaHeight - height) / 2;
    this.x = x;
    this.y = y;
  }
/**
   * Centers the viewport over the area with the supplied dimensions.
   *
   * @param areaWidth  the width of the area.
   * @param areaHeight the height of the area.
   * @throws IllegalArgumentException if either of the supplied dimensions aren't greater than
   *                                  zero.
   */
Centers the viewport over the area with the supplied dimensions.
@param areaWidth  the width of the area.
@param areaHeight the height of the area.
@throws IllegalArgumentException if either of the supplied dimensions aren't greater than
zero.
Centers the viewport over the area with the supplied dimensions . @param areaWidth the width of the area . @param areaHeight the height of the area . @throws IllegalArgumentException if either of the supplied dimensions aren ' t greater than zero .
void center(int areaWidth, int areaHeight) {
    if ((areaWidth < 1) || (areaHeight < 1)) {
      String msg = "Bad area dimensions: (" + areaWidth + "x" + areaHeight + ")";
      throw new IllegalArgumentException(msg);
    }
    int x = -(areaWidth - width) / 2;
    int y = -(areaHeight - height) / 2;
    this.x = x;
    this.y = y;
  }
void center ( int areaWidth , int areaHeight ) { if ( ( areaWidth < 1 ) || ( areaHeight < 1 ) ) { String msg = "Bad area dimensions: (" + areaWidth + "x" + areaHeight + ")" ; throw new IllegalArgumentException ( msg ) ; } int x = - ( areaWidth - width ) / 2 ; int y = - ( areaHeight - height ) / 2 ; this . x = x ; this . y = y ; }
Centers the viewport over the area with the supplied dimensions.
Centers the viewport over the area with the supplied dimensions .