mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Test QImage instead of QPixmap for render.
Trying to fix a strange crash inside QWidget::render().
This commit is contained in:
parent
8bb4d31409
commit
ba1f1af83e
1 changed files with 5 additions and 4 deletions
|
@ -2387,10 +2387,11 @@ void DialogsWidget::startWidthAnimation() {
|
||||||
auto grabGeometry = QRect(scrollGeometry.x(), scrollGeometry.y(), st::dialogsWidthMin, scrollGeometry.height());
|
auto grabGeometry = QRect(scrollGeometry.x(), scrollGeometry.y(), st::dialogsWidthMin, scrollGeometry.height());
|
||||||
_scroll->setGeometry(grabGeometry);
|
_scroll->setGeometry(grabGeometry);
|
||||||
myEnsureResized(_scroll);
|
myEnsureResized(_scroll);
|
||||||
_widthAnimationCache = QPixmap(grabGeometry.size() * cIntRetinaFactor());
|
auto image = QImage(grabGeometry.size() * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
|
||||||
_widthAnimationCache.setDevicePixelRatio(cRetinaFactor());
|
image.setDevicePixelRatio(cRetinaFactor());
|
||||||
_widthAnimationCache.fill(Qt::transparent);
|
image.fill(Qt::transparent);
|
||||||
_scroll->render(&_widthAnimationCache, QPoint(0, 0), QRect(QPoint(0, 0), grabGeometry.size()), QWidget::DrawChildren | QWidget::IgnoreMask);
|
_scroll->render(&image, QPoint(0, 0), QRect(QPoint(0, 0), grabGeometry.size()), QWidget::DrawChildren | QWidget::IgnoreMask);
|
||||||
|
_widthAnimationCache = App::pixmapFromImageInPlace(std::move(image));
|
||||||
_scroll->setGeometry(scrollGeometry);
|
_scroll->setGeometry(scrollGeometry);
|
||||||
_scroll->hide();
|
_scroll->hide();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue