class DotGrid::Pattern::GridPlusLines

Constants

DARK_LINE_SPACING
DARK_LINE_WIDTH

Public Instance Methods

draw() click to toggle source
# File lib/dot_grid/pattern/grid_plus_lines.rb, line 19
def draw
  pdf.stroke_color grid_color
  draw_grid do |row, column|
    draw_row(row) if column == 0
    draw_column(column) if row == 0
  end
end
draw_column(column) click to toggle source
# File lib/dot_grid/pattern/grid_plus_lines.rb, line 15
def draw_column(column)
  pdf.stroke_vertical_line(0, bounds.height, :at => column*spacing)
end
draw_row(row) click to toggle source
# File lib/dot_grid/pattern/grid_plus_lines.rb, line 8
def draw_row(row)
  pdf.mask(:line_width) do 
    pdf.line_width (row % DARK_LINE_SPACING == 0) ? DARK_LINE_WIDTH : pdf.line_width 
    pdf.stroke_horizontal_line(0, bounds.width, :at => row*spacing) 
  end 
end