Class: HexaPDF::Layout::TextLayouter::Glue
- Inherits:
-
Object
- Object
- HexaPDF::Layout::TextLayouter::Glue
- Defined in:
- lib/hexapdf/layout/text_layouter.rb
Overview
Used for layouting. Describes a glue item, i.e. an item describing white space that could potentially be shrunk or stretched.
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
The wrapped item.
-
#shrinkability ⇒ Object
readonly
The amount by which the glue could be shrunk.
-
#stretchability ⇒ Object
readonly
The amount by which the glue could be stretched.
Instance Method Summary collapse
-
#initialize(item, stretchability = item.width / 2, shrinkability = item.width / 3) ⇒ Glue
constructor
Creates a new Glue for the item.
-
#type ⇒ Object
Returns :glue.
-
#width ⇒ Object
The width of the item.
Constructor Details
#initialize(item, stretchability = item.width / 2, shrinkability = item.width / 3) ⇒ Glue
Creates a new Glue for the item.
116 117 118 119 120 |
# File 'lib/hexapdf/layout/text_layouter.rb', line 116 def initialize(item, stretchability = item.width / 2, shrinkability = item.width / 3) @item = item @stretchability = stretchability @shrinkability = shrinkability end |
Instance Attribute Details
#item ⇒ Object (readonly)
The wrapped item.
107 108 109 |
# File 'lib/hexapdf/layout/text_layouter.rb', line 107 def item @item end |
#shrinkability ⇒ Object (readonly)
The amount by which the glue could be shrunk.
113 114 115 |
# File 'lib/hexapdf/layout/text_layouter.rb', line 113 def shrinkability @shrinkability end |
#stretchability ⇒ Object (readonly)
The amount by which the glue could be stretched.
110 111 112 |
# File 'lib/hexapdf/layout/text_layouter.rb', line 110 def stretchability @stretchability end |