mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix crash in video message without a thumbnail.
This commit is contained in:
parent
da18ab3d41
commit
2dda044dd1
1 changed files with 17 additions and 10 deletions
|
@ -473,16 +473,23 @@ void Gif::draw(Painter &p, const PaintContext &context) const {
|
||||||
} else if (const auto blurred = _dataMedia->thumbnailInline()) {
|
} else if (const auto blurred = _dataMedia->thumbnailInline()) {
|
||||||
p.drawPixmap(rthumb.topLeft(), blurred->pixSingle(size, args.blurred()));
|
p.drawPixmap(rthumb.topLeft(), blurred->pixSingle(size, args.blurred()));
|
||||||
} else if (!unwrapped) {
|
} else if (!unwrapped) {
|
||||||
const auto roundTop = (roundCorners & RectPart::TopLeft);
|
if (roundRadius == ImageRoundRadius::Ellipse) {
|
||||||
const auto roundBottom = (roundCorners & RectPart::BottomLeft);
|
PainterHighQualityEnabler hq(p);
|
||||||
const auto margin = inWebPage
|
p.setPen(Qt::NoPen);
|
||||||
? st::roundRadiusSmall
|
p.setBrush(st->imageBg());
|
||||||
: st::historyMessageRadius;
|
p.drawEllipse(rthumb);
|
||||||
const auto parts = roundCorners
|
} else {
|
||||||
| RectPart::NoTopBottom
|
const auto roundTop = (roundCorners & RectPart::TopLeft);
|
||||||
| (roundTop ? RectPart::Top : RectPart::None)
|
const auto roundBottom = (roundCorners & RectPart::BottomLeft);
|
||||||
| (roundBottom ? RectPart::Bottom : RectPart::None);
|
const auto margin = inWebPage
|
||||||
Ui::FillRoundRect(p, rthumb.marginsAdded({ 0, roundTop ? 0 : margin, 0, roundBottom ? 0 : margin }), st->imageBg(), roundRadius, parts);
|
? st::roundRadiusSmall
|
||||||
|
: st::historyMessageRadius;
|
||||||
|
const auto parts = roundCorners
|
||||||
|
| RectPart::NoTopBottom
|
||||||
|
| (roundTop ? RectPart::Top : RectPart::None)
|
||||||
|
| (roundBottom ? RectPart::Bottom : RectPart::None);
|
||||||
|
Ui::FillRoundRect(p, rthumb.marginsAdded({ 0, roundTop ? 0 : margin, 0, roundBottom ? 0 : margin }), st->imageBg(), roundRadius, parts);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
paintPath(p, context, rthumb);
|
paintPath(p, context, rthumb);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue