Class: CTioga2::Graphics::Styles::MarkerStringStyle
- Inherits:
-
BasicStyle
- Object
- BasicStyle
- CTioga2::Graphics::Styles::MarkerStringStyle
- Defined in:
- lib/ctioga2/graphics/styles/texts.rb
Overview
The style for a string marker. Hmmm, this is somewhat redundant with TiogaPrimitiveCall::MarkerOptions and I don’t like that.
Constant Summary
Constants inherited from BasicStyle
BasicStyle::AllStyles, BasicStyle::OldAttrAccessor
Instance Attribute Summary collapse
-
#mode ⇒ Object
The rendering mode.
Instance Method Summary collapse
-
#draw_marker(t, marker, x, y) ⇒ Object
Draws the string marker at the given location.
-
#draw_string_marker(t, text, x, y) ⇒ Object
Draws the string marker at the given location.
-
#initialize ⇒ MarkerStringStyle
constructor
A new instance of MarkerStringStyle.
-
#real_vertical_scale ⇒ Object
Returns the true vertical scale of the marker.
Methods inherited from BasicStyle
attr_accessor, attribute_type, attribute_types, attributes, deprecated_attribute, from_hash, inherited, #instance_variable_defined?, options_hash, #set_from_hash, sub_style, sub_styles, #to_hash, typed_attribute, #update_from_other
Constructor Details
#initialize ⇒ MarkerStringStyle
239 240 241 242 243 244 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 239 def initialize # It make sense to use both by default, as it would be # confusing to provide both fill_ and stroke_color that # don't have effects by default... @mode = Tioga::FigureConstants::FILL_AND_STROKE end |
Instance Attribute Details
#mode ⇒ Object
The rendering mode.
237 238 239 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 237 def mode @mode end |
Instance Method Details
#draw_marker(t, marker, x, y) ⇒ Object
Draws the string marker at the given location
256 257 258 259 260 261 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 256 def draw_marker(t, marker, x, y) dict = self.to_hash dict['marker'] = marker dict['at'] = [x, y] t.show_marker(dict) end |
#draw_string_marker(t, text, x, y) ⇒ Object
Draws the string marker at the given location
248 249 250 251 252 253 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 248 def draw_string_marker(t, text, x, y) dict = self.to_hash dict['text'] = text dict['at'] = [x, y] t.show_marker(dict) end |
#real_vertical_scale ⇒ Object
Returns the true vertical scale of the marker
264 265 266 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 264 def real_vertical_scale return (@vertical_scale || 1.0) * (@scale || 1.0) end |