lib/chunky_png/canvas/operations.rb
# Checks whether another image has the correct dimension to be used for
# an operation on the current image, given an offset coordinate to work
# with.
# @param [ChunkyPNG::Canvas] other The other canvas
# @param [Integer] offset_x The x offset on which the other image will be
#   applied.
# @param [Integer] offset_y The y offset on which the other image will be
#   applied.
# @raise [ChunkyPNG::OutOfBounds] when the other image doesn't fit.
Checks whether another image has the correct dimension to be used for
an operation on the current image, given an offset coordinate to work
with.
Checks whether another image has the correct dimension to be used for an operation on the current image given an offset coordinate to work with .
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
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
Checks whether another image has the correct dimension to be used for
an operation on the current image, given an offset coordinate to work
with.
Checks whether another image has the correct dimension to be used for an operation on the current image given an offset coordinate to work with .
[ChunkyPNG::OutOfBounds] when the other image doesn't fit.
[ ChunkyPNG :: OutOfBounds ] when the other image doesn ' t fit .
other
<not_specific>
offset_x
<not_specific>
offset_y
<not_specific>
<not_specific>
offset_y The y offset on which the other image will be applied.
offset_y The y offset on which the other image will be applied .