public double snap(double value){
  if (gridEnabled) {
    value=Math.round(value / gridSize) * gridSize;
  }
  return value;
}

public double snap ( double value ) { if ( gridEnabled ) { value = Math . round ( value / gridSize ) * gridSize ; } return value ; }
snaps the given numeric value to the grid if < gridenabled > is true .
