class Rabbit::Renderer::PrintLayout2
Public Class Methods
new(renderer, canvas)
click to toggle source
Calls superclass method
Rabbit::Renderer::PrintLayout::new
# File lib/rabbit/renderer/print-layout.rb, line 64 def initialize(renderer, canvas) super @margin_left ||= 50 @margin_right ||= 50 @margin_top ||= 30 @margin_bottom ||= 30 end
Public Instance Methods
normalize_x(x)
click to toggle source
# File lib/rabbit/renderer/print-layout.rb, line 80 def normalize_x(x) x + @margin_left end
normalize_y(y)
click to toggle source
# File lib/rabbit/renderer/print-layout.rb, line 84 def normalize_y(y) base = @margin_bottom if below? base += @margin_top + @margin_bottom + slide_height end y + base end
slide_height()
click to toggle source
# File lib/rabbit/renderer/print-layout.rb, line 76 def slide_height (@renderer.page_height / 2) - @margin_top - @margin_bottom end
slide_width()
click to toggle source
# File lib/rabbit/renderer/print-layout.rb, line 72 def slide_width @renderer.page_width - @margin_left - @margin_right end
Private Instance Methods
below?()
click to toggle source
# File lib/rabbit/renderer/print-layout.rb, line 93 def below? (@canvas.current_index % 2) == 1 end