Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Stretchy bounding box only respects most recent nested stretchy bounding box's height #487

Open
orangethunder opened this Issue · 1 comment

2 participants

@orangethunder

I think code says it best. This is using 1.0.0.rc2. Apologies if I'm misunderstanding the intended behaviour (or if it's fixed on master):

require 'rubygems'
require 'prawn'

Prawn::Document.generate("test.pdf") do
  bounding_box([0, cursor], :width => bounds.right) do
    bounding_box([0, bounds.top], :width => 100) do
      text "Left Line 1"
      text "Left Line 2"
    end
    bounding_box([100, bounds.top], :width => 100) do
      text "Right Line 1"
    end
  end
  text "This line should not overlap, should it?"
end
@practicingruby practicingruby removed the stale label
@practicingruby

Sorry for the very delayed response.

I agree that this is a confusing behavior, and it's something I'm open to change. The bad news is that it's the officially documented behavior.

If the box is 'stretchy' (unspecified height attribute), height is calculated 
as the distance from the top of the box to the current drawing position.

Because we've already cut our 1.0 release and marked this behavior as stable, we'd need to add some sort of flag to change its behavior that is off by default.

Even better though would be for us to route around this problem by figuring out how to do this kind of task at a higher level. Bounding boxes are awkward things to work with, and so I'd almost rather invest the time into building better user-level layout tools.

Re-opening this for commentary and further thought.

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.