extended getIntersection method for Layer to improve flexibility.  Replaced instances of Math.round to bitwise round via | 0 for a small performance gain