8000 coerce args for bitmap.SetWidth/SetHeight to be ints in PrintoutWx.On… · matplotlib/matplotlib@5c961f7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c961f7

Browse files
committed
coerce args for bitmap.SetWidth/SetHeight to be ints in PrintoutWx.OnPrintPage
svn path=/trunk/matplotlib/; revision=1346
1 parent 4f52d18 commit 5c961f7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,17 +1916,16 @@ def OnPrintPage(self, page):
19161916
fig_dpi = self.canvas.figure.dpi.get()
19171917

19181918
# draw the bitmap, scaled appropriately
1919-
vscale = ppw / fig_dpi
1919+
vscale = float(ppw) / fig_dpi
19201920

19211921
# set figure resolution,bg color for printer
19221922
self.canvas.figure.dpi.set(ppw)
19231923
self.canvas.figure.set_facecolor('#FFFFFF')
19241924

1925-
19261925
renderer = RendererWx(self.canvas.bitmap, self.canvas.figure.dpi)
19271926
self.canvas.figure.draw(renderer)
1928-
self.canvas.bitmap.SetWidth( self.canvas.bitmap.GetWidth() * vscale)
1929-
self.canvas.bitmap.SetHeight(self.canvas.bitmap.GetHeight()* vscale)
1927+
self.canvas.bitmap.SetWidth( int(self.canvas.bitmap.GetWidth() * vscale))
1928+
self.canvas.bitmap.SetHeight( int(self.canvas.bitmap.GetHeight()* vscale))
19301929
self.canvas.draw()
19311930

19321931
# page may need additional scaling on preview

0 commit comments

Comments
 (0)
0