Class: Glimmer::LibUI::Shape::Figure
- Inherits:
-
Glimmer::LibUI::Shape
- Object
- Glimmer::LibUI::Shape
- Glimmer::LibUI::Shape::Figure
- Defined in:
- lib/glimmer/libui/shape/figure.rb
Overview
Represents a figure consisting of shapes (nested under path) Can optionally have ‘closed true` property (connecting last point to first point automatically)
Instance Attribute Summary
Attributes inherited from Glimmer::LibUI::Shape
#args, #block, #keyword, #parent
Instance Method Summary collapse
- #closed(value = nil) ⇒ Object (also: #closed=, #set_closed, #closed?)
- #draw(area_draw_params) ⇒ Object
Methods inherited from Glimmer::LibUI::Shape
#area_proxy, constant_symbol, create, #destroy, exists?, #initialize, #method_missing, parameter_defaults, parameters, #path_proxy, #post_add_content, #redraw, #respond_to?, shape_class
Methods included from Parent
#children, #post_initialize_child
Constructor Details
This class inherits a constructor from Glimmer::LibUI::Shape
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Glimmer::LibUI::Shape
Instance Method Details
#closed(value = nil) ⇒ Object Also known as: closed=, set_closed, closed?
40 41 42 43 44 45 46 47 |
# File 'lib/glimmer/libui/shape/figure.rb', line 40 def closed(value = nil) if value.nil? @closed else @closed = value area_proxy&.queue_redraw_all end end |
#draw(area_draw_params) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/glimmer/libui/shape/figure.rb', line 33 def draw(area_draw_params) ::LibUI.draw_path_new_figure(path_proxy.libui, *@args) unless @args.compact.empty? # TODO if args empty then wait till there is an arc child and it starts the figure children.dup.each {|child| child.draw(area_draw_params)} ::LibUI.draw_path_close_figure(path_proxy.libui) if closed? super end |