expand Rectangle 2D - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

expand Rectangle 2D

Demo Code


//package com.java2s;

import java.awt.geom.Rectangle2D;

public class Main {
    public static Rectangle2D expandRectangle2D(Rectangle2D r, double dx,
            double dy) {
        return new Rectangle2D.Double(r.getX() - dx, r.getY() - dy,
                r.getWidth() + dx * 2, r.getHeight() + dy * 2);
    }/* www . ja  v a  2s .c o  m*/
}

Related Tutorials