Class: Rabbit::Renderer::Print::LayoutMore
- Inherits:
-
LayoutBase
- Object
- LayoutBase
- Rabbit::Renderer::Print::LayoutMore
- Defined in:
- lib/rabbit/renderer/print/layout.rb
Instance Method Summary collapse
-
#initialize(renderer) ⇒ LayoutMore
constructor
A new instance of LayoutMore.
- #normalize_x(x) ⇒ Object
- #normalize_y(y) ⇒ Object
- #slide_height ⇒ Object
- #slide_width ⇒ Object
Methods inherited from LayoutBase
Constructor Details
#initialize(renderer) ⇒ LayoutMore
Returns a new instance of LayoutMore.
74 75 76 77 78 79 80 |
# 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 |
Instance Method Details
#normalize_x(x) ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/rabbit/renderer/print/layout.rb', line 91 def normalize_x(x) base = @margin_left unless left? base += @margin_left + @margin_right + end x + base end |
#normalize_y(y) ⇒ Object
99 100 101 102 103 104 105 |
# 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 += * nth_col y + base end |
#slide_height ⇒ Object
86 87 88 89 |
# File 'lib/rabbit/renderer/print/layout.rb', line 86 def base = page_height / ( / 2.0).ceil base - @margin_top - @margin_bottom end |
#slide_width ⇒ Object
82 83 84 |
# File 'lib/rabbit/renderer/print/layout.rb', line 82 def (page_width / 2) - @margin_left - @margin_right end |