From 1777cd4b293ba432572ebb435ef011d396ee9675 Mon Sep 17 00:00:00 2001 From: prculley Date: Thu, 28 Dec 2017 09:35:39 -0600 Subject: [PATCH] Fix Fan Chart Print centering and scaling on Windows Fixes #8460 --- gramps/gui/widgets/fanchart.py | 4 +++- gramps/gui/widgets/fanchart2way.py | 4 +++- gramps/plugins/view/fanchart2wayview.py | 2 -- gramps/plugins/view/fanchartdescview.py | 2 -- gramps/plugins/view/fanchartview.py | 2 -- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py index 259d87633..e3df26d52 100644 --- a/gramps/gui/widgets/fanchart.py +++ b/gramps/gui/widgets/fanchart.py @@ -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)) diff --git a/gramps/gui/widgets/fanchart2way.py b/gramps/gui/widgets/fanchart2way.py index 47b3faf6a..9ba8331d2 100644 --- a/gramps/gui/widgets/fanchart2way.py +++ b/gramps/gui/widgets/fanchart2way.py @@ -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 diff --git a/gramps/plugins/view/fanchart2wayview.py b/gramps/plugins/view/fanchart2wayview.py index ac68cc6b5..602bef352 100644 --- a/gramps/plugins/view/fanchart2wayview.py +++ b/gramps/plugins/view/fanchart2wayview.py @@ -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): diff --git a/gramps/plugins/view/fanchartdescview.py b/gramps/plugins/view/fanchartdescview.py index cdffc7bce..d75f88eb4 100644 --- a/gramps/plugins/view/fanchartdescview.py +++ b/gramps/plugins/view/fanchartdescview.py @@ -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): diff --git a/gramps/plugins/view/fanchartview.py b/gramps/plugins/view/fanchartview.py index 7f455e3a9..2e3add55c 100644 --- a/gramps/plugins/view/fanchartview.py +++ b/gramps/plugins/view/fanchartview.py @@ -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):