This commit is contained in:
Kovid Goyal 2016-08-30 09:41:53 +05:30
parent 68c1303c21
commit 3f434bee3f

View File

@ -343,9 +343,9 @@ class ImageView(QWidget, ImageDropMixin): # {{{
cw, ch = self.rect().width(), self.rect().height() cw, ch = self.rect().width(), self.rect().height()
scaled, nw, nh = fit_image(w, h, cw, ch) scaled, nw, nh = fit_image(w, h, cw, ch)
if scaled: if scaled:
pmap = pmap.scaled(nw*pmap.devicePixelRatio(), nh*pmap.devicePixelRatio(), Qt.IgnoreAspectRatio, pmap = pmap.scaled(int(nw*pmap.devicePixelRatio()), int(nh*pmap.devicePixelRatio()), Qt.IgnoreAspectRatio,
Qt.SmoothTransformation) Qt.SmoothTransformation)
w, h = pmap.width()/pmap.devicePixelRatio(), pmap.height()/pmap.devicePixelRatio() w, h = int(pmap.width()/pmap.devicePixelRatio()), int(pmap.height()/pmap.devicePixelRatio())
x = int(abs(cw - w)/2.) x = int(abs(cw - w)/2.)
y = int(abs(ch - h)/2.) y = int(abs(ch - h)/2.)
target = QRect(x, y, w, h) target = QRect(x, y, w, h)