summaryrefslogtreecommitdiff
path: root/lib/asciidoctor/pdf/converter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asciidoctor/pdf/converter.rb')
-rw-r--r--lib/asciidoctor/pdf/converter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index d4339661..2c1f9952 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -3082,7 +3082,8 @@ module Asciidoctor
end
unless scratch? || !(bg_color = @theme[%(#{category_caption}_background_color)] || @theme.caption_background_color)
caption_height = height_of_typeset_text string
- fill_at = [bounds.left, cursor + (margin[:top] || 0)]
+ fill_at = [bounds.left, cursor]
+ fill_at[1] -= (margin[:top] || 0) unless at_page_top?
float { bounding_box(fill_at, width: container_width, height: caption_height) { fill_bounds bg_color } }
end
indent(*indent_by) do