Parent

Methods

Prawn::Format::Effects::Underline

Public Class Methods

new(from, state) click to toggle source
# File lib/prawn/format/effects/underline.rb, line 7
def initialize(from, state)
  @from = from
  @state = state
end

Public Instance Methods

finish(document, draw_state) click to toggle source
# File lib/prawn/format/effects/underline.rb, line 12
def finish(document, draw_state)
  x1 = draw_state[:x] + @from
  x2 = draw_state[:x] + draw_state[:dx]
  y  = draw_state[:y] + draw_state[:dy] - 2

  document.stroke_color(@state.color)
  document.move_to(x1, y)
  document.line_to(x2, y)
  document.stroke
end
wrap(document, draw_state) click to toggle source
# File lib/prawn/format/effects/underline.rb, line 23
def wrap(document, draw_state)
  finish(document, draw_state)
  @from = 0
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.