Sha256: 218fe7f5ff603555772b137003da30c4a9541617794a823f2a9b287df2aac304

Contents?: true

Size: 802 Bytes

Versions: 13

Compression:

Stored size: 802 Bytes

Contents

# encoding: utf-8
# 
# Rounded rectangle example demonstrating both stroke and stroke and fill. 
# A rectangle with rounded join_style is added just for comparison.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

pdf = Prawn::Document.new
pdf.font_size 8
pdf.draw_text "a stroked rounded rectangle:", :at => [30, 575]
pdf.stroke_rounded_rectangle([50, 550], 50, 100, 10)
pdf.draw_text "a stroked and filled rounded rectangle:", :at => [180, 575]
pdf.fill_and_stroke_rounded_rectangle([200, 550], 50, 100, 10)
pdf.draw_text "a regular rectangle with rounded join style;", :at => [330, 575]
pdf.draw_text "needs thick line width for similar result:", :at => [330, 565]
pdf.join_style :round
pdf.line_width 10
pdf.stroke_rectangle([350, 550], 50, 100)

pdf.render_file "rounded_rectangle.pdf"

Version data entries

13 entries across 13 versions & 6 rubygems

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