* fixes for #284 #295 #296 Also added option --full-expansion-dividers * Add front offsets for issue #248 Added options to offset front (similar to what existed for the backside).
This commit is contained in:
parent
9a7a5938f8
commit
1bd731222e
@ -642,7 +642,11 @@ class DividerDrawer(object):
|
|||||||
|
|
||||||
def wantCentreTab(self, card):
|
def wantCentreTab(self, card):
|
||||||
return (
|
return (
|
||||||
card.isExpansion() and self.options.centre_expansion_dividers
|
card.isExpansion()
|
||||||
|
and (
|
||||||
|
self.options.centre_expansion_dividers
|
||||||
|
or self.options.full_expansion_dividers
|
||||||
|
)
|
||||||
) or self.options.tab_side == "centre"
|
) or self.options.tab_side == "centre"
|
||||||
|
|
||||||
def drawOutline(self, item, isBack=False):
|
def drawOutline(self, item, isBack=False):
|
||||||
@ -672,7 +676,9 @@ class DividerDrawer(object):
|
|||||||
theTabWidth = item.tabWidth
|
theTabWidth = item.tabWidth
|
||||||
theTabHeight = item.tabHeight
|
theTabHeight = item.tabHeight
|
||||||
|
|
||||||
left2tab = item.getTabOffset(backside=isBack)
|
left2tab = item.getTabOffset(
|
||||||
|
backside=False
|
||||||
|
) # translate/scale above takes care of backside
|
||||||
right2tab = dividerWidth - tabLabelWidth - left2tab
|
right2tab = dividerWidth - tabLabelWidth - left2tab
|
||||||
nearZero = 0.01
|
nearZero = 0.01
|
||||||
left2tab = left2tab if left2tab > nearZero else 0
|
left2tab = left2tab if left2tab > nearZero else 0
|
||||||
@ -1551,6 +1557,10 @@ class DividerDrawer(object):
|
|||||||
self.options.back_offset, self.options.back_offset_height
|
self.options.back_offset, self.options.back_offset_height
|
||||||
)
|
)
|
||||||
pageWidth -= 2 * self.options.back_offset
|
pageWidth -= 2 * self.options.back_offset
|
||||||
|
else:
|
||||||
|
self.canvas.translate(
|
||||||
|
self.options.front_offset, self.options.front_offset_height
|
||||||
|
)
|
||||||
|
|
||||||
item.translate(self.canvas, pageWidth, isBack)
|
item.translate(self.canvas, pageWidth, isBack)
|
||||||
|
|
||||||
@ -1908,7 +1918,11 @@ class DividerDrawer(object):
|
|||||||
if lastCardSet != card.cardset_tag:
|
if lastCardSet != card.cardset_tag:
|
||||||
# In a new expansion, so reset the tabs to start over
|
# In a new expansion, so reset the tabs to start over
|
||||||
nextTabIndex = CardPlot.tabRestart()
|
nextTabIndex = CardPlot.tabRestart()
|
||||||
if options.tab_number > Card.sets[card.cardset_tag]["count"]:
|
if (
|
||||||
|
options.tab_number > Card.sets[card.cardset_tag]["count"]
|
||||||
|
and Card.sets[card.cardset_tag]["count"] > 0
|
||||||
|
):
|
||||||
|
|
||||||
# Limit to the number of tabs to the number of dividers in the expansion
|
# Limit to the number of tabs to the number of dividers in the expansion
|
||||||
CardPlot.tabSetup(
|
CardPlot.tabSetup(
|
||||||
tabNumber=Card.sets[card.cardset_tag]["count"]
|
tabNumber=Card.sets[card.cardset_tag]["count"]
|
||||||
@ -1932,6 +1946,13 @@ class DividerDrawer(object):
|
|||||||
textTypeBack=options.text_back,
|
textTypeBack=options.text_back,
|
||||||
stackHeight=card.getStackHeight(options.thickness),
|
stackHeight=card.getStackHeight(options.thickness),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if card.isExpansion() and options.full_expansion_dividers:
|
||||||
|
# Fix up the item to have a full tab with text centred
|
||||||
|
item.tabWidth = cardWidth
|
||||||
|
item.tabNumber = 1
|
||||||
|
item.tabOffset = 0
|
||||||
|
|
||||||
if (
|
if (
|
||||||
options.flip
|
options.flip
|
||||||
and (options.tab_number == 2)
|
and (options.tab_number == 2)
|
||||||
|
|||||||
@ -344,7 +344,13 @@ def parse_opts(cmdline_args=None):
|
|||||||
"--centre-expansion-dividers",
|
"--centre-expansion-dividers",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
dest="centre_expansion_dividers",
|
dest="centre_expansion_dividers",
|
||||||
help="Centre the tabs on expansion dividers.",
|
help="Centre the tabs on expansion dividers (same width as dividers.)",
|
||||||
|
)
|
||||||
|
group_expansion.add_argument(
|
||||||
|
"--full-expansion-dividers",
|
||||||
|
action="store_true",
|
||||||
|
dest="full_expansion_dividers",
|
||||||
|
help="Full width expansion dividers.",
|
||||||
)
|
)
|
||||||
group_expansion.add_argument(
|
group_expansion.add_argument(
|
||||||
"--expansion-reset-tabs",
|
"--expansion-reset-tabs",
|
||||||
@ -589,6 +595,20 @@ def parse_opts(cmdline_args=None):
|
|||||||
default=0.1,
|
default=0.1,
|
||||||
help="Width of lines for card outlines and crop marks.",
|
help="Width of lines for card outlines and crop marks.",
|
||||||
)
|
)
|
||||||
|
group_printing.add_argument(
|
||||||
|
"--front-offset",
|
||||||
|
type=float,
|
||||||
|
dest="front_offset",
|
||||||
|
default=0,
|
||||||
|
help="Front page horizontal offset points to shift to the right. Only needed for some printers.",
|
||||||
|
)
|
||||||
|
group_printing.add_argument(
|
||||||
|
"--front-offset-height",
|
||||||
|
type=float,
|
||||||
|
dest="front_offset_height",
|
||||||
|
default=0,
|
||||||
|
help="Front page vertical offset points to shift upward. Only needed for some printers.",
|
||||||
|
)
|
||||||
group_printing.add_argument(
|
group_printing.add_argument(
|
||||||
"--back-offset",
|
"--back-offset",
|
||||||
type=float,
|
type=float,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user