module Dieses::Geometry::Rect::Predicate

Public Instance Methods

cover?(element) click to toggle source
# File lib/dieses/geometry/rect.rb, line 106
def cover?(element)
  bbox = element.bbox
  inside?(bbox.minimum) && inside?(bbox.maximum)
end
inside?(point) click to toggle source
# File lib/dieses/geometry/rect.rb, line 92
def inside?(point)
  onto?(point) || (
    left.right?(point) && right.left?(point) && top.left?(point) && bottom.right?(point)
  )
end
onto?(point) click to toggle source
# File lib/dieses/geometry/rect.rb, line 102
def onto?(point)
  left.onto?(point) || right.onto?(point) || top.onto?(point) || bottom.onto?(point)
end
outside?(point) click to toggle source
# File lib/dieses/geometry/rect.rb, line 98
def outside?(point)
  !inside?(point)
end