Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

start_new_page within bounding_box block moves the bounding_box on the next page... #411

Closed
zinkkrysty opened this Issue · 3 comments

4 participants

@zinkkrysty

... but the content stays on the first page as it should

I have a bounding_box which behaves like a table (I'm not using Table because I need to create graphics inside some cells)

bounding_box [0, cursor], width: bounds.width do
      cars.each_with_index do |car, i|
        cars_table_row car, i+1
      end
      stroke_bounds
end

Inside the cars_table_row method I have this:

start_new_page if index % 13 == 0

That makes the bounding box jump on the next page and the stroke_bounds only strokes the last page. I don't grasp how the content is shown on the front page if the bounding_box is stroked only on the second page.

If this is not a bug, is there a better way to start new pages inside a bounding_box? Or to divide a bounding box that doesn't necessarily contain text into multiple pages?

Here's a screenshot of my issue: http://cl.ly/image/1W1M3h413L2p

@jasontduncan

Same issue here, with text-only content.

@jonsgreen
Collaborator

You might try this:

stroke_bounds && start_new_page if index % 13 == 0

I would be curious to know if that gets you anywhere.

@zinkkrysty

Yes that works. Thanks!

@yob yob closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.