Method: HexaPDF::Content::GraphicObject::Geom2D#configure
- Defined in:
- lib/hexapdf/content/graphic_object/geom2d.rb
#configure(object: nil, point_radius: nil, path_only: nil) ⇒ Object
Configures the Geom2D drawing support object. The following arguments are allowed:
- :object
-
The object that should be drawn. If this argument has not been set before and is also not given, an error will be raised when calling #draw.
- :point_radius
-
The radius of the points when drawing points.
- :path_only
-
Whether only the path should be drawn.
Any arguments not specified are not modified and retain their old value, see the getter methods for the inital values.
Returns self.
Examples:
#>pdf-center
obj = canvas.graphic_object(:geom2d, object: ::Geom2D::Point(0, 0))
canvas.draw(obj)
canvas.opacity(fill_alpha: 0.5).fill_color("hp-blue").
draw(obj, point_radius: 10)
124 125 126 127 128 129 |
# File 'lib/hexapdf/content/graphic_object/geom2d.rb', line 124 def configure(object: nil, point_radius: nil, path_only: nil) @object = object if object @point_radius = point_radius if point_radius @path_only = path_only if path_only self end |