Fix Fan Chart Print centering and scaling on Windows

Fixes #8460
This commit is contained in:
prculley 2017-12-28 09:35:39 -06:00 committed by Nick Hall
parent 3971fecb29
commit 1777cd4b29
5 changed files with 6 additions and 8 deletions

View File

@ -1221,7 +1221,9 @@ class FanChartWidget(FanChartBaseWidget):
cr.scale(scale, scale)
if widget:
self.center_xy = self.center_xy_from_delta()
cr.translate(*self.center_xy)
cr.translate(*self.center_xy)
else:
cr.translate(halfdist, halfdist)
cr.save()
cr.rotate(math.radians(self.rotate_value))

View File

@ -374,7 +374,9 @@ class FanChart2WayWidget(FanChartWidget, FanChartDescWidget):
cr.scale(scale, scale)
if widget:
self.center_xy = self.center_xy_from_delta()
cr.translate(*self.center_xy)
cr.translate(*self.center_xy)
else:
cr.translate(halfdist, halfdist)
cr.save()
# Draw background

View File

@ -528,8 +528,6 @@ class CairoPrintSave():
pxwidth = round(context.get_width())
pxheight = round(context.get_height())
scale = min(pxwidth/self.widthpx, pxheight/self.heightpx)
if scale > 1:
scale = 1
self.drawfunc(None, cr, scale=scale)
def on_paginate(self, operation, context):

View File

@ -516,8 +516,6 @@ class CairoPrintSave:
pxwidth = round(context.get_width())
pxheight = round(context.get_height())
scale = min(pxwidth/self.widthpx, pxheight/self.heightpx)
if scale > 1:
scale = 1
self.drawfunc(None, cr, scale=scale)
def on_paginate(self, operation, context):

View File

@ -523,8 +523,6 @@ class CairoPrintSave:
pxwidth = round(context.get_width())
pxheight = round(context.get_height())
scale = min(pxwidth/self.widthpx, pxheight/self.heightpx)
if scale > 1:
scale = 1
self.drawfunc(None, cr, scale=scale)
def on_paginate(self, operation, context):