diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-05-16 03:36:37 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-05-16 04:17:40 -0600 |
| commit | 1f0a43a1a450d8d4e1d1990881b6719e6a7c7bb5 (patch) | |
| tree | 70c0060a2953027651d76133816de9112a74f941 /spec/converter_spec.rb | |
| parent | 65cb0f745ffa0c4092ee23e43580730e0f40380e (diff) | |
use correct left value when creating bounding box
Diffstat (limited to 'spec/converter_spec.rb')
| -rw-r--r-- | spec/converter_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index 69c83c12..128bfad2 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -1050,6 +1050,41 @@ describe Asciidoctor::PDF::Converter do end end + describe 'Bounding Box' do + it 'should use correct left value when creating bounding box', visual: true do + backend = nil + create_class (Asciidoctor::Converter.for 'pdf') do + register_for (backend = %(pdf#{object_id}).to_sym) + def traverse node + return super unless node.context == :document + column_box [0, cursor], columns: 2, width: bounds.width, reflow_margins: true, spacer: 12 do + bounds.move_past_bottom + super + end + end + end + + pdf_theme = { caption_background_color: 'EEEEEE' } + input = <<~'EOS' + = Article Title + + * list item + + NOTE: admonition + + > quote + + .Block title + ---- + code block <1> + ---- + <1> Callout description + EOS + + (expect to_pdf_file input, 'bounding-box-left.pdf', backend: backend, pdf_theme: pdf_theme).to visually_match 'bounding-box-left.pdf' + end + end + describe 'extend' do it 'should use specified extended converter' do backend = nil |
