Class: Glimmer::LibUI::Shape::Polygon
- Inherits:
-
Glimmer::LibUI::Shape
- Object
- Glimmer::LibUI::Shape
- Glimmer::LibUI::Shape::Polygon
- Defined in:
- lib/glimmer/libui/shape/polygon.rb
Instance Attribute Summary
Attributes inherited from Glimmer::LibUI::Shape
#args, #block, #content_added, #keyword, #parent
Instance Method Summary collapse
Methods inherited from Glimmer::LibUI::Shape
#area_proxy, constant_symbol, #content, create, #destroy, exists?, #fill, #initialize, #method_missing, parameter_defaults, parameters, #path_proxy, #post_add_content, #post_initialize_child, #redraw, #request_auto_redraw, #respond_to?, shape_class, #stroke, #transform
Methods included from DataBindable
#data_bind, #data_bind_read, #data_bind_write, #data_binding_model_attribute_observer_registrations
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
#draw(area_draw_params) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/glimmer/libui/shape/polygon.rb', line 31 def draw(area_draw_params) alternating_x_y_array = point_array.to_a.compact.flatten unless alternating_x_y_array.empty? ::LibUI.draw_path_new_figure(path_proxy.libui, alternating_x_y_array[0], alternating_x_y_array[1]) ((alternating_x_y_array.size - 2) / 2).times do |n| point_alternating_x_y_index = n * 2 ::LibUI.draw_path_line_to(path_proxy.libui, alternating_x_y_array[point_alternating_x_y_index + 2], alternating_x_y_array[point_alternating_x_y_index + 3]) end ::LibUI.draw_path_close_figure(path_proxy.libui) end super end |