Here you can find the source of enlargeRectangle(Rectangle2D rect, double d)
Parameter | Description |
---|---|
rect | The rectangle to enlarge. |
d | The enlargement to apply. |
public static void enlargeRectangle(Rectangle2D rect, double d)
//package com.java2s; //License from project: Apache License import java.awt.geom.*; public class Main { /**/*w w w . j av a 2 s . c om*/ * Enlarges the passed rectangle by d in all directions. * @param rect The rectangle to enlarge. * @param d The enlargement to apply. */ public static void enlargeRectangle(Rectangle2D rect, double d) { if (rect == null) { throw new IllegalArgumentException(); } rect.setRect(rect.getX() - d, rect.getY() - d, rect.getWidth() + 2 * d, rect.getHeight() + 2 * d); } }