module ChunkyPNG::Canvas::Operations

def check_size_constraints!(other, offset_x, offset_y)

Raises:
  • (ChunkyPNG::OutOfBounds) - when the other image doesn't fit.

Parameters:
  • offset_y (Integer) -- The y offset on which the other image will be
  • offset_x (Integer) -- The x offset on which the other image will be
  • other (ChunkyPNG::Canvas) -- The other canvas
def check_size_constraints!(other, offset_x, offset_y)
  if width  < other.width  + offset_x
    raise ChunkyPNG::OutOfBounds, 'Background image width is too small!'
  end
  if height < other.height + offset_y
    raise ChunkyPNG::OutOfBounds, 'Background image height is too small!'
  end
end