Anyone know of any API or any way of easily coding a 'snap to grid' feature?