Class: Shoes::Common::ArtElement
- Defined in:
- shoes-core/lib/shoes/common/art_element.rb
Constant Summary collapse
- REDRAW_OFFSET_FACTOR =
Redrawing needs a bit of extra room. We offset by this factor, then extend our size by twice that to evenly surround the whole thing.
1
- REDRAW_SIZING_FACTOR =
REDRAW_OFFSET_FACTOR * 2
Constants included from Style
Style::DEFAULT_STYLES, Style::STYLE_GROUPS
Instance Attribute Summary
Attributes included from Clickable
Attributes inherited from UIElement
#app, #dimensions, #gui, #parent
Instance Method Summary collapse
- #painted? ⇒ Boolean
- #redraw_height ⇒ Object
- #redraw_left ⇒ Object
- #redraw_top ⇒ Object
- #redraw_width ⇒ Object
Methods included from Translate
#clear_translate, #translate_left, #translate_top
Methods included from Stroke
Methods included from Rotate
Methods included from Fill
Methods included from Clickable
#click, #pass_coordinates?, #register_click, #release
Methods inherited from UIElement
#add_to_parent, #after_initialize, #before_initialize, #create_backend, #create_dimensions, #handle_block, #initialize, #needs_rotate?, #update_fill, #update_stroke
Methods included from Style
#applicable_app_styles, #create_style_hash, included, #style, #style_init
Methods included from SafelyEvaluate
Methods included from Remove
Methods included from Positioning
Methods included from Visibility
#hidden?, #hidden_from_view?, #hide, #outside_parent_view?, #show, #toggle, #visible?
Methods included from Inspect
Methods included from Attachable
Constructor Details
This class inherits a constructor from Shoes::Common::UIElement
Instance Method Details
#painted? ⇒ Boolean
18 19 20 |
# File 'shoes-core/lib/shoes/common/art_element.rb', line 18 def painted? true end |
#redraw_height ⇒ Object
42 43 44 45 |
# File 'shoes-core/lib/shoes/common/art_element.rb', line 42 def redraw_height return 0 unless element_height element_height + strokewidth.ceil * REDRAW_SIZING_FACTOR end |
#redraw_left ⇒ Object
27 28 29 30 |
# File 'shoes-core/lib/shoes/common/art_element.rb', line 27 def redraw_left return 0 unless element_left element_left - strokewidth.ceil * REDRAW_OFFSET_FACTOR end |
#redraw_top ⇒ Object
32 33 34 35 |
# File 'shoes-core/lib/shoes/common/art_element.rb', line 32 def redraw_top return 0 unless element_top element_top - strokewidth.ceil * REDRAW_OFFSET_FACTOR end |
#redraw_width ⇒ Object
37 38 39 40 |
# File 'shoes-core/lib/shoes/common/art_element.rb', line 37 def redraw_width return 0 unless element_width element_width + strokewidth.ceil * REDRAW_SIZING_FACTOR end |