Class: CTioga2::Graphics::Styles::ArrowStyle
- Inherits:
-
StrokeStyle
- Object
- BasicStyle
- LineStyle
- StrokeStyle
- CTioga2::Graphics::Styles::ArrowStyle
- Defined in:
- lib/ctioga2/graphics/styles/arrows.rb
Overview
This class represents an arrow
Constant Summary
Constants inherited from BasicStyle
BasicStyle::AllStyles, BasicStyle::OldAttrAccessor
Instance Method Summary collapse
Methods inherited from StrokeStyle
Methods inherited from LineStyle
Methods inherited from BasicStyle
alias_for, aliases, attr_accessor, attribute_type, attribute_types, attributes, convert_string_hash, defined_aliases, deprecated_attribute, from_hash, inherited, #instance_variable_defined?, normalize_hash, normalize_in, normalize_out, options_hash, #set_from_hash, sub_style, sub_styles, #to_hash, typed_attribute, #update_from_other
Instance Method Details
#draw_arrow(t, x1, y1, x2, y2) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ctioga2/graphics/styles/arrows.rb', line 38 def draw_arrow(t, x1, y1, x2, y2) dict = self.to_hash dict.rename_key('width', 'line_width') dict.rename_key('style', 'line_style') dict['head'] = [x2,y2] dict['tail'] = [x1,y1] for w in %w(head tail) if dict["#{w}_marker"] == false dict["#{w}_marker"] = "None" end end t.show_arrow(dict) end |