Class: HexaPDF::Layout::Frame::FitData
- Inherits:
-
Object
- Object
- HexaPDF::Layout::Frame::FitData
- Defined in:
- lib/hexapdf/layout/frame.rb
Overview
Internal class for storing data of a fitted box.
Instance Attribute Summary collapse
-
#available_height ⇒ Object
The available height for this particular box.
-
#available_width ⇒ Object
The available width for this particular box.
-
#box ⇒ Object
The box that was fitted into the frame.
-
#margin_left ⇒ Object
The left margin to use instead of
box.style.margin.left
. -
#margin_right ⇒ Object
The right margin to use instead of
box.style.margin.right
. -
#margin_top ⇒ Object
The top margin to use instead of
box.style.margin.top
.
Instance Method Summary collapse
-
#initialize ⇒ FitData
constructor
Initialize the object by calling #reset.
-
#reset(box = nil, available_width = 0, available_height = 0) ⇒ Object
Resets the object.
Constructor Details
#initialize ⇒ FitData
Initialize the object by calling #reset.
115 116 117 |
# File 'lib/hexapdf/layout/frame.rb', line 115 def initialize reset end |
Instance Attribute Details
#available_height ⇒ Object
The available height for this particular box.
103 104 105 |
# File 'lib/hexapdf/layout/frame.rb', line 103 def available_height @available_height end |
#available_width ⇒ Object
The available width for this particular box.
100 101 102 |
# File 'lib/hexapdf/layout/frame.rb', line 100 def available_width @available_width end |
#box ⇒ Object
The box that was fitted into the frame.
97 98 99 |
# File 'lib/hexapdf/layout/frame.rb', line 97 def box @box end |
#margin_left ⇒ Object
The left margin to use instead of box.style.margin.left
.
106 107 108 |
# File 'lib/hexapdf/layout/frame.rb', line 106 def margin_left @margin_left end |
#margin_right ⇒ Object
The right margin to use instead of box.style.margin.right
.
109 110 111 |
# File 'lib/hexapdf/layout/frame.rb', line 109 def margin_right @margin_right end |
#margin_top ⇒ Object
The top margin to use instead of box.style.margin.top
.
112 113 114 |
# File 'lib/hexapdf/layout/frame.rb', line 112 def margin_top @margin_top end |
Instance Method Details
#reset(box = nil, available_width = 0, available_height = 0) ⇒ Object
Resets the object.
120 121 122 123 124 125 |
# File 'lib/hexapdf/layout/frame.rb', line 120 def reset(box = nil, available_width = 0, available_height = 0) @box = box @available_width = available_width @available_height = available_height @margin_left = @margin_right = @margin_top = 0 end |