From 09223c530fe0484774692d7d8d0521d0482d5417 Mon Sep 17 00:00:00 2001 From: "Christopher H.Barker, PhD" Date: Thu, 13 Apr 2017 11:17:36 -0700 Subject: [PATCH] added float() calls to get the proper divison when scaling bitmaps In response to a note from Kevin Gregory: "" Sorry to email you directly, I wanted to submit a bugfix for FloatCanvas ScaledBitmap. It changes the bmpWidth and bmpHeight from integers to floats so that the scale is computed correctly. FCObjects.py line 2141 from the wxpython phoenix dev build """ --- wx/lib/floatcanvas/FCObjects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/lib/floatcanvas/FCObjects.py b/wx/lib/floatcanvas/FCObjects.py index ec382e0a..a4cfd97b 100644 --- a/wx/lib/floatcanvas/FCObjects.py +++ b/wx/lib/floatcanvas/FCObjects.py @@ -2138,7 +2138,7 @@ class ScaledBitmap(TextObjectMixin, DrawObject): self.XY = XY self.Height = Height - (self.bmpWidth, self.bmpHeight) = self.Image.GetWidth(), self.Image.GetHeight() + (self.bmpWidth, self.bmpHeight) = float(self.Image.GetWidth()), float(self.Image.GetHeight()) self.Width = self.bmpWidth / self.bmpHeight * Height self.ShiftFun = self.ShiftFunDict[Position] self.CalcBoundingBox() @@ -2225,7 +2225,7 @@ class ScaledBitmap2(TextObjectMixin, DrawObject, ): self.XY = N.array(XY, N.float) self.Height = Height - (self.bmpWidth, self.bmpHeight) = self.Image.GetWidth(), self.Image.GetHeight() + (self.bmpWidth, self.bmpHeight) = float(self.Image.GetWidth()), float(self.Image.GetHeight()) self.bmpWH = N.array((self.bmpWidth, self.bmpHeight), N.int32) ## fixme: this should all accommodate different scales for X and Y if Width is None: