lib/chunky_png/canvas/operations.rb in chunky_png-1.2.1 vs lib/chunky_png/canvas/operations.rb in chunky_png-1.2.2
- old
+ new
@@ -97,10 +97,12 @@
# @see #replace
def replace!(other, offset_x = 0, offset_y = 0)
check_size_constraints!(other, offset_x, offset_y)
for y in 0...other.height do
- pixels[(y + offset_y) * width + offset_x, other.width] = other.pixels[y * other.width, other.width]
+ for d in 0...other.width
+ pixels[(y + offset_y) * width + offset_x + d] = other.pixels[y * other.width + d]
+ end
end
self
end
# Replaces pixels on this image by pixels from another pixels, on a given offset.