lib/gamebox/lib/rect.rb
# Fix Rects that have negative width or height, without changing the
# area it represents. Has no effect on Rects with non-negative width
# and height. Some Rect methods will automatically normalize the Rect.
Fix Rects that have negative width or height, without changing the
area it represents. Has no effect on Rects with non-negative width
and height. Some Rect methods will automatically normalize the Rect.
Fix Rects that have negative width or height without changing the area it represents . Has no effect on Rects with non - negative width and height . Some Rect methods will automatically normalize the Rect .
def normalize!
    if self[2] < 0
      self[0], self[2] = self[0]+self[2], -self[2]
    end
    if self[3] < 0
      self[1], self[3] = self[1]+self[3], -self[3]
    end
    self
  end
def normalize! if self [ 2 ] < 0 self [ 0 ] , self [ 2 ] = self [ 0 ] + self [ 2 ] , - self [ 2 ] end if self [ 3 ] < 0 self [ 1 ] , self [ 3 ] = self [ 1 ] + self [ 3 ] , - self [ 3 ] end self end
Fix Rects that have negative width or height, without changing the
area it represents.
Fix Rects that have negative width or height without changing the area it represents .