From 53ce6cb26b0339364f9c3569e4b8964fd74cb59a Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 24 Jun 2023 16:21:43 -0600 Subject: reuse width and height of bounds when creating text box for text table cell --- lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb | 6 ++---- 1 file 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 -- cgit v1.2.3