/*
 * Created on Apr 28, 2003
 *
 * To change this generated comment go to 
 * Window>Preferences>Java>Code Generation>Code Template
 */
package jdraw.std;

import java.awt.Point;

import jdraw.framework.PointConstrainer;

/**
 * @author Christoph
 */
public class Grid5 implements PointConstrainer {
	
	public Point constrainPoint(Point p) {
		return new Point(Math.round(p.x/5.0f)*5, Math.round(p.y/5.0f)*5);
	}

	/* (non-Javadoc)
	 * @see jdraw.framework.PointConstrainer#getStepX()
	 */
	public int getStepX() {
		return 5;
	}

	/* (non-Javadoc)
	 * @see jdraw.framework.PointConstrainer#getStepY()
	 */
	public int getStepY() {
		return 5;
	}

}
