diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-06-24 16:21:43 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2023-06-24 16:21:43 -0600 |
| commit | 53ce6cb26b0339364f9c3569e4b8964fd74cb59a (patch) | |
| tree | 8c22903e568d0e0ded75bb95db4d610ced72450f | |
| parent | 447e3635c2b74749a93f7682687c292240085350 (diff) | |
reuse width and height of bounds when creating text box for text table cell
| -rw-r--r-- | lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb b/lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb index e2b2640a..a1c76305 100644 --- a/lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb +++ b/lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb @@ -10,11 +10,9 @@ class Prawn::Table::Cell::Text def draw_content with_font do self.valign = [:center, -font.descender * 0.5] if valign == :center + bounds = @pdf.bounds remaining_text = with_text_color do - (text_box \ - width: spanned_content_width + FPTolerance, - height: spanned_content_height + FPTolerance, - at: [0, @pdf.cursor]).render + (text_box width: bounds.width, height: bounds.height, at: [0, @pdf.cursor]).render end unless remaining_text.empty? || @pdf.scratch? logger.error message_with_context %(the table cell on page #{@pdf.page_number} has been truncated; Asciidoctor PDF does not support table cell content that exceeds the height of a single page), source_location: @source_location |
