Java Rectangle Grow grow(Rectangle2D r, float amountx, float amounty)

Here you can find the source of grow(Rectangle2D r, float amountx, float amounty)

Description

grow

License

Open Source License

Declaration

public static void grow(Rectangle2D r, float amountx, float amounty) 

Method Source Code

//package com.java2s;
/**//from  w  w  w .ja  v a 2 s  .  com
 * Copyright (c) 2010-2014, Jean-Daniel Fekete, Pierre Dragicevic, and INRIA.
 * All rights reserved.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

import java.awt.geom.Rectangle2D;

public class Main {
    public static void grow(Rectangle2D r, float amountx, float amounty) {
        r.setRect(r.getX() - amountx, r.getY() - amounty, r.getWidth() + amountx * 2, r.getHeight() + amounty * 2);
    }
}

Related

  1. enlargeRectangle(Rectangle2D rect, double d)
  2. enlargeRectangle(Rectangle2D toEnlarge, double size)
  3. enlargeRectToGrid(Rectangle2D r)
  4. grow(java.awt.Rectangle rv, int xPad, int yPad)
  5. grow(Rectangle2D rec, Point2D grow)
  6. grow(Rectangle2D.Double r, double h, double v)
  7. grow(Rectangle2D.Float r, int size)
  8. growRect(Rectangle2D rect, double d)