Class: Shoes::Rect

Inherits:
Common::ArtElement show all
Defined in:
shoes-core/lib/shoes/rect.rb

Constant Summary collapse

STYLES =
{ curve: 0, fill: Shoes::COLORS[:black] }.freeze

Constants inherited from Common::ArtElement

Common::ArtElement::REDRAW_OFFSET_FACTOR, Common::ArtElement::REDRAW_SIZING_FACTOR

Constants included from Common::Style

Common::Style::DEFAULT_STYLES, Common::Style::STYLE_GROUPS

Instance Attribute Summary

Attributes included from Common::Clickable

#pass_coordinates

Attributes inherited from Common::UIElement

#app, #dimensions, #gui, #parent

Instance Method Summary collapse

Methods inherited from Common::ArtElement

#painted?, #redraw_height, #redraw_left, #redraw_top, #redraw_width

Methods included from Common::Translate

#clear_translate, #translate_left, #translate_top

Methods included from Common::Stroke

#update_stroke

Methods included from Common::Rotate

#needs_rotate?

Methods included from Common::Fill

#update_fill

Methods included from Common::Clickable

#click, #pass_coordinates?, #register_click, #release

Methods inherited from Common::UIElement

#add_to_parent, #after_initialize, #before_initialize, #create_backend, #handle_block, #initialize, #needs_rotate?, #painted?, #redraw_height, #redraw_left, #redraw_top, #redraw_width, #update_fill, #update_stroke

Methods included from Common::Style

#applicable_app_styles, #create_style_hash, included, #style, #style_init

Methods included from Common::SafelyEvaluate

#safely_evaluate

Methods included from Common::Remove

#remove

Methods included from Common::Positioning

#_position, #displace, #move

Methods included from Common::Visibility

#hidden?, #hidden_from_view?, #hide, #outside_parent_view?, #show, #toggle, #visible?

Methods included from Common::Inspect

#inspect, #to_s

Methods included from Common::Attachable

#attached_to

Constructor Details

This class inherits a constructor from Shoes::Common::UIElement

Instance Method Details

#create_dimensions(left, top, width, height) ⇒ Object



8
9
10
11
12
13
14
15
# File 'shoes-core/lib/shoes/rect.rb', line 8

def create_dimensions(left, top, width, height)
  left   ||= @style[:left] || 0
  top    ||= @style[:top] || 0
  width  ||= @style[:width] || 0
  height ||= @style[:height] || width

  @dimensions = AbsoluteDimensions.new left, top, width, height, @style
end