Class: Glimmer::LibUI::Shape::Rectangle

Inherits:
Glimmer::LibUI::Shape show all
Defined in:
lib/glimmer/libui/shape/rectangle.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, #bounding_box, constant_symbol, #contain?, #content, create, #destroy, exists?, #fill, #include?, #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
# File 'lib/glimmer/libui/shape/rectangle.rb', line 31

def draw(area_draw_params)
  ::LibUI.draw_path_add_rectangle(path_proxy.libui, *@args)
  super
end

#perfect_shapeObject



36
37
38
39
40
41
42
43
# File 'lib/glimmer/libui/shape/rectangle.rb', line 36

def perfect_shape
  perfect_shape_dependencies = [x, y, width, height]
  if perfect_shape_dependencies != @perfect_shape_dependencies
    x, y, width, height = @perfect_shape_dependencies = perfect_shape_dependencies
    @perfect_shape = PerfectShape::Rectangle.new(x: x, y: y, width: width, height: height)
  end
  @perfect_shape
end