lib/middleware/scaler.rb in tracksperanto-2.9.5 vs lib/middleware/scaler.rb in tracksperanto-2.9.6

- old
+ new

@@ -1,11 +1,15 @@ # -*- encoding : utf-8 -*- # Scales the comp being exported by a specific factor, together with the tracker keyframes class Tracksperanto::Middleware::Scaler < Tracksperanto::Middleware::Base DEFAULT_FACTOR = 1 - attr_accessor :x_factor, :y_factor - cast_to_float :x_factor, :y_factor + parameter :x_factor, :cast => :float, :desc => "Factor to scale by", :default => DEFAULT_FACTOR + parameter :y_factor, :cast => :float, :desc => "Factor to scale by", :default => 0.5 + + def self.action_description + "Scale the comp by a specified factor" + end # Called on export start def start_export( img_width, img_height) set_residual_factor @w, @h = (img_width * x_factor).to_i.abs, (img_height * y_factor).to_i.abs