Skip to content

Commit

Permalink
Fix Fan Chart Print centering and scaling on Windows
Browse files Browse the repository at this point in the history
Fixes #8460
  • Loading branch information
prculley authored and Nick-Hall committed Jan 4, 2018
1 parent 3971fec commit 1777cd4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 3 additions & 1 deletion gramps/gui/widgets/fanchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,9 @@ def on_draw(self, widget, cr, scale=1.):
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))
Expand Down
4 changes: 3 additions & 1 deletion gramps/gui/widgets/fanchart2way.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ def on_draw(self, widget, cr, scale=1.):
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
Expand Down
2 changes: 0 additions & 2 deletions gramps/plugins/view/fanchart2wayview.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,6 @@ def on_draw_page(self, operation, context, page_nr):
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):
Expand Down
2 changes: 0 additions & 2 deletions gramps/plugins/view/fanchartdescview.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ def on_draw_page(self, operation, context, page_nr):
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):
Expand Down
2 changes: 0 additions & 2 deletions gramps/plugins/view/fanchartview.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,6 @@ def on_draw_page(self, operation, context, page_nr):
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):
Expand Down

0 comments on commit 1777cd4

Please sign in to comment.