Sha256: 7cf4488d630981ee856bca17a98a9d621a002aeec88f4db66db6c356087764b5

Contents?: true

Size: 825 Bytes

Versions: 6

Compression:

Stored size: 825 Bytes

Contents

# encoding: utf-8
#
# The join style defines how the intersection between two lines is drawn. There
# are three types: <code>:miter</code> (the default), <code>:round</code> and
# <code>:bevel</code>
#
# Just like <code>cap_style</code>, the difference between styles is better
# seen with thicker lines.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  stroke_axis

  self.line_width = 25

  [:miter, :round, :bevel].each_with_index do |style, i|
    self.join_style = style

    y = 200 - i*100
    stroke do
      move_to(100, y)
      line_to(200, y + 100)
      line_to(300, y)
    end
    stroke_rectangle [400, y + 75], 50, 50
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
prawn-git-2.0.1 manual/graphics/stroke_join.rb
prawn-2.0.1 manual/graphics/stroke_join.rb
prawn-2.0.0 manual/graphics/stroke_join.rb
prawn-1.3.0 manual/graphics/stroke_join.rb
prawn-1.2.1 manual/graphics/stroke_join.rb
prawn-1.1.0 manual/graphics/stroke_join.rb