dash.rb

Path: dash.rb
Last Update: Sat May 10 10:01:44 -0300 2008

Sets the dash pattern on border lines. It reads one array all of which must be non-negative numbers and not all zero. It behavior this way

 [2,1]     #=> 2 turn on and 1 off, 2 turn on and 1 off ...
 [3,1,2,5] #=> 3 on, 1 off, 2 on, 5 off ... repeating until end

Examples using dash as border parameter

 d=Document.new
 d.horizontal_line(:bottom, :border=>{:dash => 1, :width => 2 })

 d=Document.new
 d.horizontal_line(:bottom, :border=>{:dash => [1,1], :width => 2 })

 d=Document.new
 d.horizontal_line(:bottom, :border=>{:dash => [1,2,1], :width => 2 })

 d=Document.new
 d.horizontal_line(:bottom, :border=>{:dash => [2,10,5], :width => 2 })

 d=Document.new
 d.horizontal_line(:bottom, :border=>{:dash => [1,1,3,1,5,1,7,1,9,1,10], :width => 4 })

Examples using Dash class

 d=Document.new
 d.scale(1,8)
 d.set Dash.new([1,1,2,1,2,1,3])
 d.line_width 3
 d.lineto :x => :limit_right, :y => :Y

[Validate]