When no text was on the front of a wrapper, the back wrapper text and tab were not in the proper location. This was due to exiting the routine without doing the self.canvas.restoreState(). Cleaned up the code to be easier to read and to exit cleanly.
This commit is contained in:
parent
c4c44bfbea
commit
c843e5970d
@ -782,21 +782,17 @@ class DividerDrawer(object):
|
|||||||
usedHeight += 15
|
usedHeight += 15
|
||||||
|
|
||||||
# Figure out what text is to be printed on this divider
|
# Figure out what text is to be printed on this divider
|
||||||
if divider_text == "blank":
|
descriptions = None
|
||||||
# blank divider, no need to go on
|
if divider_text == "card" and card.description:
|
||||||
return
|
|
||||||
elif divider_text == "rules":
|
|
||||||
# Add the extra rules text to the divider
|
|
||||||
if card.extra:
|
|
||||||
descriptions = card.extra
|
|
||||||
else:
|
|
||||||
# Asked for rules and they don't exist, so don't print anything
|
|
||||||
return
|
|
||||||
elif divider_text == "card":
|
|
||||||
# Add the card text to the divider
|
# Add the card text to the divider
|
||||||
descriptions = card.description
|
descriptions = card.description
|
||||||
else:
|
elif divider_text == "rules" and card.extra:
|
||||||
# Don't know what was asked, so don't print anything
|
# Add the extra rules text to the divider
|
||||||
|
descriptions = card.extra
|
||||||
|
|
||||||
|
if descriptions is None:
|
||||||
|
# No text to print, so exit early and cleanly
|
||||||
|
self.canvas.restoreState()
|
||||||
return
|
return
|
||||||
|
|
||||||
s = getSampleStyleSheet()['BodyText']
|
s = getSampleStyleSheet()['BodyText']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user