Class: Glimmer::LibUI::Shape::Circle
- Inherits:
-
Glimmer::LibUI::Shape
- Object
- Glimmer::LibUI::Shape
- Glimmer::LibUI::Shape::Circle
- Defined in:
- lib/glimmer/libui/shape/circle.rb
Instance Attribute Summary
Attributes inherited from Glimmer::LibUI::Shape
#args, #block, #keyword, #parent
Instance Method Summary collapse
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
#draw(area_draw_params) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/glimmer/libui/shape/circle.rb', line 31 def draw(area_draw_params) arc_args = @args.dup arc_args[3] = 0 arc_args[4] = Math::PI * 2.0 arc_args[5] = 0 if parent.is_a?(Figure) && parent.x.nil? && parent.y.nil? ::LibUI.draw_path_new_figure_with_arc(path_proxy.libui, *arc_args) else ::LibUI.draw_path_arc_to(path_proxy.libui, *arc_args) end super end |
#include?(x, y) ⇒ Boolean
44 45 46 |
# File 'lib/glimmer/libui/shape/circle.rb', line 44 def include?(x, y) (x - x_center)**2 + (y - y_center)**2 < radius**2 end |