Skip to content

Commit

Permalink
Make sure a flow's canv attribute is assigned before drawing it. Th…
Browse files Browse the repository at this point in the history
…is fixes having a `fixedSize` inside a `place`.
  • Loading branch information
strichter committed Dec 1, 2018
1 parent bdf39b1 commit 1db8db5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/z3c/rml/canvas.py
Expand Up @@ -419,6 +419,7 @@ def process(self):

canvas = attr.getManager(self, interfaces.ICanvasManager).canvas
for flow in flows.flow:
flow.canv = canvas
flowWidth, flowHeight = flow.wrap(width, height)
if flowWidth <= width and flowHeight <= height:
y -= flowHeight
Expand Down
Binary file modified src/z3c/rml/tests/expected/tag-place.pdf
Binary file not shown.
26 changes: 26 additions & 0 deletions src/z3c/rml/tests/input/tag-place.rml
Expand Up @@ -53,5 +53,31 @@
<para>A paragraph within the place.</para>
</place>

<drawString x="1cm" y="8cm">
Below is a place with fitted content.
</drawString>

<place
x="1cm" y="6cm" width="13cm" height="1.5cm">
<fixedSize width="13cm" height="1.5cm">
<para>
A long paragraph within the place.
A long paragraph within the place.
A long paragraph within the place.
A long paragraph within the place.
</para>
<para>
A second long paragraph.
A second long paragraph.
A second long paragraph.
A second long paragraph.
A second long paragraph.
A second long paragraph.
A second long paragraph.
A second long paragraph.
</para>
</fixedSize>
</place>

</pageDrawing>
</document>

0 comments on commit 1db8db5

Please sign in to comment.