Class: HexaPDF::Layout::Frame::FitData

Inherits:
Object
  • Object
show all
Defined in:
lib/hexapdf/layout/frame.rb

Overview

Internal class for storing data of a fitted box.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFitData

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_heightObject

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_widthObject

The available width for this particular box.



100
101
102
# File 'lib/hexapdf/layout/frame.rb', line 100

def available_width
  @available_width
end

#boxObject

The box that was fitted into the frame.



97
98
99
# File 'lib/hexapdf/layout/frame.rb', line 97

def box
  @box
end

#margin_leftObject

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_rightObject

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_topObject

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