lib/perfect_shape/line.rb in perfect-shape-0.5.1 vs lib/perfect_shape/line.rb in perfect-shape-0.5.2
- old
+ new
@@ -20,11 +20,10 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
require 'perfect_shape/shape'
require 'perfect_shape/point'
require 'perfect_shape/multi_point'
-require 'perfect_shape/rectangle'
module PerfectShape
class Line < Shape
class << self
# Returns an indicator of where the specified point (px,py) lies with respect to the line segment from
@@ -242,9 +241,10 @@
return unless x && y
Line.point_crossings(points[0][0], points[0][1], points[1][0], points[1][1], x, y)
end
def intersect?(rectangle)
+ require 'perfect_shape/rectangle'
x1 = points[0][0]
y1 = points[0][1]
x2 = points[1][0]
y2 = points[1][1]
out1 = out2 = nil