Class: Rabbit::Renderer::PrintLayout2
Constant Summary
Constants inherited
from PrintLayout
Rabbit::Renderer::PrintLayout::MAPPING
Instance Method Summary
collapse
Methods inherited from PrintLayout
create
Constructor Details
Returns a new instance of PrintLayout2.
[View source]
64
65
66
67
68
69
70
|
# 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
|
Instance Method Details
permalink
#normalize_x(x) ⇒ Object
[View source]
80
81
82
|
# File 'lib/rabbit/renderer/print-layout.rb', line 80
def normalize_x(x)
x + @margin_left
end
|
permalink
#normalize_y(y) ⇒ Object
[View source]
84
85
86
87
88
89
90
|
# 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
|
permalink
#slide_height ⇒ Object
[View source]
76
77
78
|
# File 'lib/rabbit/renderer/print-layout.rb', line 76
def slide_height
(@renderer.page_height / 2) - @margin_top - @margin_bottom
end
|
permalink
#slide_width ⇒ Object
[View source]
72
73
74
|
# File 'lib/rabbit/renderer/print-layout.rb', line 72
def slide_width
@renderer.page_width - @margin_left - @margin_right
end
|