Sha256: f3fa21ed170cc1e6e0fe0a8c0a9fa42a2f4c0cdfcd17187a9488fcb4ea90f6df

Contents?: true

Size: 904 Bytes

Versions: 16

Compression:

Stored size: 904 Bytes

Contents

# encoding: utf-8   

# join_style.rb : Implements stroke join styling
#
# Contributed by Daniel Nelson. October, 2009
#
# This is free software. Please see the LICENSE and COPYING files for details.
#
module Prawn
  module Graphics
    module JoinStyle
      JOIN_STYLES = { :miter => 0, :round => 1, :bevel => 2 }
      
      # Sets the join style for stroked lines and curves
      #
      # style is one of :miter, :round, or :bevel
      #
      # NOTE: if this method is never called, :miter will be used for join style
      # throughout the document
      #
      def join_style(style=nil)
        return @join_style || :miter if style.nil?

        @join_style = style

        write_stroke_join_style
      end
      
      alias_method :join_style=, :join_style

      private

      def write_stroke_join_style
        add_content "#{JOIN_STYLES[@join_style]} j"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 7 rubygems

Version Path
davebenvenuti-prawn-0.11.1.pre lib/prawn/graphics/join_style.rb
piglop-prawn-0.10.2.3 lib/prawn/graphics/join_style.rb
piglop-prawn-0.10.2.2 lib/prawn/graphics/join_style.rb
piglop-prawn-0.10.2.1 lib/prawn/graphics/join_style.rb
prawn-0.11.1.pre lib/prawn/graphics/join_style.rb
goodwill-prawn-edge-0.10.0 lib/prawn/graphics/join_style.rb
alphasights-prawn-0.10.4 lib/prawn/graphics/join_style.rb
alphasights-prawn-0.10.3 lib/prawn/graphics/join_style.rb
alphasights-prawn-0.10.2 lib/prawn/graphics/join_style.rb
alphasights-prawn-0.10.1 lib/prawn/graphics/join_style.rb
alphasights-prawn-0.10.0 lib/prawn/graphics/join_style.rb
prawn-core-0.8.4 lib/prawn/graphics/join_style.rb
prawn-graph-0.0.2 vendor/prawn-core/lib/prawn/graphics/join_style.rb
prawn-graph-0.0.1 vendor/prawn-core/lib/prawn/graphics/join_style.rb
prawn-core-0.7.2 lib/prawn/graphics/join_style.rb
prawn-core-0.7.1 lib/prawn/graphics/join_style.rb