mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
QtQuick: use the right bounds when painting
Use textureSize as the documentation suggests, contentsSize is deprecated. Sometimes this size is invalid, use textureSize in such case.
This commit is contained in:
parent
9d64765c21
commit
c51419dd9f
|
@ -319,9 +319,9 @@ void PageItem::paint(QPainter *painter)
|
|||
m_intentionalDraw = false;
|
||||
}
|
||||
const int flags = PagePainter::Accessibility | PagePainter::Highlights | PagePainter::Annotations;
|
||||
// Simply using the limits as described by contentsSize will, at times, result in the page painter
|
||||
// Simply using the limits as described by textureSize will, at times, result in the page painter
|
||||
// attempting to write outside the data area, unsurprisingly resulting in a crash.
|
||||
QRect limits(QPoint(0, 0), contentsSize());
|
||||
QRect limits(QPoint(0, 0), textureSize().isValid() ? textureSize() : QSize(width(), height()));
|
||||
if(limits.width() > width())
|
||||
limits.setWidth(width());
|
||||
if(limits.height() > height())
|
||||
|
|
Loading…
Reference in a new issue