Method: ChunkyPNG::Canvas::Operations#rotate_left!
- Defined in:
- lib/chunky_png/canvas/operations.rb
#rotate_left! ⇒ ChunkyPNG::Canvas Also known as: rotate_counter_clockwise!
Rotates the image 90 degrees counter-clockwise in place.
This method will change the original canvas. See #rotate_left for a version that leaves the canvas intact and returns a new rotated canvas instead.
246 247 248 249 250 |
# File 'lib/chunky_png/canvas/operations.rb', line 246 def rotate_left! new_pixels = [] (width - 1).downto(0) { |i| new_pixels += column(i) } replace_canvas!(height, width, new_pixels) end |