lib/ctioga2/graphics/styles/drawable.rb in ctioga2-0.4 vs lib/ctioga2/graphics/styles/drawable.rb in ctioga2-0.5

- old
+ new

@@ -15,32 +15,27 @@ require 'ctioga2/log' # This module contains all the classes used by ctioga module CTioga2 - Version::register_svn_info('$Revision: 350 $', '$Date: 2012-12-25 22:23:35 +0100 (Tue, 25 Dec 2012) $') + Version::register_svn_info('$Revision: 419 $', '$Date: 2013-08-23 01:05:42 +0200 (Fri, 23 Aug 2013) $') module Graphics # All the styles module Styles - # This class represents all the stylistic information to stroke - # a Tioga path. - class StrokeStyle < BasicStyle - # The color - typed_attribute :color, 'color-or-false' - + # This class represents a plain line style. + class LineStyle < BasicStyle # The line style typed_attribute :style, 'line-style' # The line width typed_attribute :width, 'float' # Sets the stroke style to a FigureMaker object, _t_. def set_stroke_style(t) - t.stroke_color = @color if @color t.line_type = @style if @style t.line_width = @width if @width end # Draws a line according with this style @@ -48,9 +43,23 @@ t.context do set_stroke_style(t) t.stroke_line(x1, y1, x2, y2) end end + end + + # This class represents all the stylistic information to stroke + # a Tioga path. + class StrokeStyle < LineStyle + # The color + typed_attribute :color, 'color-or-false' + + # Sets the stroke style to a FigureMaker object, _t_. + def set_stroke_style(t) + t.stroke_color = @color if @color + super + end + end # This class represents all the stylistic information to draw a # Marker. #