/*
 * 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 Grid10 implements PointConstrainer {
	
	public Point constrainPoint(Point p) {
		return new Point(Math.round(p.x/10.0f)*10, Math.round(p.y/10.0f)*10);
	}

	/* (non-Javadoc)
	 * @see jdraw.framework.PointConstrainer#getStepX()
	 */
	public int getStepX() {
		return 10;
	}

	/* (non-Javadoc)
	 * @see jdraw.framework.PointConstrainer#getStepY()
	 */
	public int getStepY() {
		return 10;
	}

}
