mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
A couple more places that needed non-integer dpr support
This commit is contained in:
parent
6e158af47c
commit
fc43a34b68
@ -108,7 +108,10 @@ class ImageDelegate(QStyledItemDelegate):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
dpr = painter.device().devicePixelRatio()
|
try:
|
||||||
|
dpr = painter.device().devicePixelRatioF()
|
||||||
|
except AttributeError:
|
||||||
|
dpr = painter.device().devicePixelRatio()
|
||||||
cover.loadFromData(raw)
|
cover.loadFromData(raw)
|
||||||
cover.setDevicePixelRatio(dpr)
|
cover.setDevicePixelRatio(dpr)
|
||||||
if not cover.isNull():
|
if not cover.isNull():
|
||||||
|
@ -373,7 +373,11 @@ class ImagesDelegate(QStyledItemDelegate):
|
|||||||
k = (th, entry.name)
|
k = (th, entry.name)
|
||||||
pmap = self.cache.get(k)
|
pmap = self.cache.get(k)
|
||||||
if pmap is None:
|
if pmap is None:
|
||||||
pmap = self.cache[k] = self.pixmap(th, entry, painter.device().devicePixelRatio())
|
try:
|
||||||
|
dpr = painter.device().devicePixelRatioF()
|
||||||
|
except AttributeError:
|
||||||
|
dpr = painter.device().devicePixelRatio()
|
||||||
|
pmap = self.cache[k] = self.pixmap(th, entry, dpr)
|
||||||
if pmap.isNull():
|
if pmap.isNull():
|
||||||
bottom = option.rect.top()
|
bottom = option.rect.top()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user