class Tracksperanto::Tool::Crop
Does the same as the Pad tool but with absolute pixel values instead of fractionals
Public Class Methods
action_description()
click to toggle source
# File lib/tools/crop.rb, line 9 def self.action_description "Crop or pad the image by a specified number of pixels" end
Public Instance Methods
start_export(w, h)
click to toggle source
# File lib/tools/crop.rb, line 13 def start_export(w, h) left_pad, right_pad, top_pad, bottom_pad = (left / w.to_f), (right / w.to_f), (top / h.to_f), (bottom / h.to_f) @pad = Tracksperanto::Tool::Pad.new(@exporter, :left_pad => left_pad, :right_pad => right_pad, :top_pad => top_pad, :bottom_pad => bottom_pad) @pad.start_export(w, h) end