Sha256: a5c1e2487227c8d610105dfef483da31ef159cc4d30d46849fe7904d80d44907

Contents?: true

Size: 735 Bytes

Versions: 2

Compression:

Stored size: 735 Bytes

Contents

# frozen_string_literal: true

Prawn::Text::Formatted::Box.prepend (Module.new do
  def draw_fragment_overlay_styles fragment
    if (underline = (styles = fragment.styles).include? :underline) || (styles.include? :strikethrough)
      (doc = fragment.document).save_graphics_state do
        if (text_decoration_width = (fs = fragment.format_state)[:text_decoration_width] || doc.text_decoration_width)
          doc.line_width = text_decoration_width
        end
        if (text_decoration_color = fs[:text_decoration_color])
          doc.stroke_color = text_decoration_color
        end
        underline ? (doc.stroke_line fragment.underline_points) : (doc.stroke_line fragment.strikethrough_points)
      end
    end
  end
end)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asciidoctor-pdf-1.5.0.rc.2 lib/asciidoctor/pdf/ext/prawn/formatted_text/box.rb
asciidoctor-pdf-1.5.0.rc.1 lib/asciidoctor/pdf/ext/prawn/formatted_text/box.rb