fix how border space is used to calculate how many tabs will fit. Fixes Avery label printing, bug #1268060
This commit is contained in:
parent
95779f7c7e
commit
b7baf57eb1
@ -746,16 +746,19 @@ class DominionTabs:
|
|||||||
|
|
||||||
self.tabHeight = self.tabBaseHeight + self.tabLabelHeight
|
self.tabHeight = self.tabBaseHeight + self.tabLabelHeight
|
||||||
|
|
||||||
|
#note: this is convenient, but somewhat inaccurate as the border space isn't actually part of the tab width
|
||||||
self.totalTabWidth = self.tabWidth + self.horizontalBorderSpace
|
self.totalTabWidth = self.tabWidth + self.horizontalBorderSpace
|
||||||
self.totalTabHeight = self.tabHeight + self.verticalBorderSpace
|
self.totalTabHeight = self.tabHeight + self.verticalBorderSpace
|
||||||
|
|
||||||
print "Paper dimensions: %fcm (w) x %fcm (h)" % (self.paperwidth / cm, self.paperheight / cm)
|
print "Paper dimensions: %fcm (w) x %fcm (h)" % (self.paperwidth / cm, self.paperheight / cm)
|
||||||
print "Tab dimensions: %fcm (w) x %fcm (h)" % (self.totalTabWidth / cm, self.totalTabHeight / cm)
|
print "Tab dimensions: %fcm (w) x %fcm (h)" % (self.totalTabWidth / cm, self.totalTabHeight / cm)
|
||||||
|
|
||||||
numTabsVerticalP = int ((self.paperheight - 2*minmarginheight) / self.totalTabHeight)
|
#as we don't draw anything in the final border, it shouldn't count towards how many tabs we can fit
|
||||||
numTabsHorizontalP = int ((self.paperwidth - 2*minmarginwidth) / self.totalTabWidth)
|
#so it gets added back in to the page size here
|
||||||
numTabsVerticalL = int ((self.paperwidth - 2*minmarginwidth) / self.totalTabHeight)
|
numTabsVerticalP = int ((self.paperheight - 2*minmarginheight + self.verticalBorderSpace) / self.totalTabHeight)
|
||||||
numTabsHorizontalL = int ((self.paperheight - 2*minmarginheight) / self.totalTabWidth)
|
numTabsHorizontalP = int ((self.paperwidth - 2*minmarginwidth + self.horizontalBorderSpace) / self.totalTabWidth)
|
||||||
|
numTabsVerticalL = int ((self.paperwidth - 2*minmarginwidth + self.verticalBorderSpace) / self.totalTabHeight)
|
||||||
|
numTabsHorizontalL = int ((self.paperheight - 2*minmarginheight + self.horizontalBorderSpace) / self.totalTabWidth)
|
||||||
|
|
||||||
if numTabsVerticalL * numTabsHorizontalL > numTabsVerticalP * numTabsHorizontalP and not fixedMargins:
|
if numTabsVerticalL * numTabsHorizontalL > numTabsVerticalP * numTabsHorizontalP and not fixedMargins:
|
||||||
self.numTabsVertical, self.numTabsHorizontal\
|
self.numTabsVertical, self.numTabsHorizontal\
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user