class Rabbit::Renderer::Print::LayoutMore

Public Class Methods

new(renderer) click to toggle source
Calls superclass method Rabbit::Renderer::Print::LayoutBase.new
# File lib/rabbit/renderer/print/layout.rb, line 74
def initialize(renderer)
  super
  @margin_left ||= 10
  @margin_right ||= 10
  @margin_top ||= 10
  @margin_bottom ||= 10
end

Public Instance Methods

normalize_x(x) click to toggle source
# File lib/rabbit/renderer/print/layout.rb, line 91
def normalize_x(x)
  base = @margin_left
  unless left?
    base += @margin_left + @margin_right + slide_width
  end
  x + base
end
normalize_y(y) click to toggle source
# File lib/rabbit/renderer/print/layout.rb, line 99
def normalize_y(y)
  nth_col = (normalized_current_index / 2.0).truncate
  base = @margin_top * (nth_col + 1)
  base += @margin_bottom * nth_col
  base += slide_height * nth_col
  y + base
end
slide_height() click to toggle source
# File lib/rabbit/renderer/print/layout.rb, line 86
def slide_height
  base = page_height / (slides_per_page / 2.0).ceil
  base - @margin_top - @margin_bottom
end
slide_width() click to toggle source
# File lib/rabbit/renderer/print/layout.rb, line 82
def slide_width
  (page_width / 2) - @margin_left - @margin_right
end

Private Instance Methods

left?() click to toggle source
# File lib/rabbit/renderer/print/layout.rb, line 108
def left?
  (normalized_current_index % 2).zero?
end
normalized_current_index() click to toggle source
# File lib/rabbit/renderer/print/layout.rb, line 112
def normalized_current_index
  current_index % slides_per_page
end