Skip to content

Commit

Permalink
resolves #421 restore cursor position after placing image in running …
Browse files Browse the repository at this point in the history
…content
  • Loading branch information
mojavelinux committed Apr 24, 2016
1 parent b821952 commit 82ce567
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/asciidoctor-pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1999,10 +1999,10 @@ def layout_running_content position, doc, opts = {}
when ::Hash
# NOTE image placement respects padding; use negative image_vertical_align value to revert
trim_v_padding = trim_padding[0] + trim_padding[2]
# NOTE bounding_box is redundant if trim_v_padding is 0
bounding_box [0, cursor - trim_padding[0]], width: bounds.width, height: (bounds.height - trim_v_padding) do
# NOTE float ensures cursor position is restored and returns us to current page if we overrun
float do
# NOTE float ensures cursor position is restored and returns us to current page if we overrun
float do
# NOTE bounding_box is redundant if trim_v_padding is 0
bounding_box [0, cursor - trim_padding[0]], width: bounds.width, height: (bounds.height - trim_v_padding) do
#image content[:path], vposition: trim_img_valign, position: align, width: content[:width]
# NOTE use :fit to prevent image from overflowing page (at the cost of scaling it)
image content[:path], vposition: trim_img_valign, position: align, fit: [content[:width], bounds.height]
Expand Down

0 comments on commit 82ce567

Please sign in to comment.