Fixed bug with image getting rescaled to zero width and height.

This commit is contained in:
Frank Vernaillen
2018-10-23 14:41:40 +02:00
parent 2f8d1b2e9a
commit 6d24a91990

View File

@@ -2333,7 +2333,7 @@ class ScaledBitmap2(TextObjectMixin, DrawObject, ):
Hb = BBbitmap[1,1] - Yb
FullHeight = ScaleWorldToPixel(self.Height)[0]
scale = FullHeight / self.bmpWH[1]
scale = float(FullHeight) / float(self.bmpWH[1])
Ws = int(scale * Wb + 0.5) # add the 0.5 to round
Hs = int(scale * Hb + 0.5)
if (self.ScaledBitmap is None) or (self.ScaledBitmap[0] != (Xb, Yb, Wb, Hb, Ws, Ws) ):