Fixed right action click handler on stickers without stickerpack.

This commit is contained in:
23rd 2019-08-16 11:13:46 +03:00 committed by John Preston
parent 3f041545bf
commit de270d5283
1 changed files with 5 additions and 1 deletions

View File

@ -278,13 +278,17 @@ TextState UnwrappedMedia::textState(QPoint point, StateRequest request) const {
auto fastShareTop = (fullBottom - st::historyFastShareBottom - st::historyFastShareSize);
if (QRect(fastShareLeft, fastShareTop, st::historyFastShareSize, st::historyFastShareSize).contains(point)) {
result.link = _parent->rightActionLink();
return result;
}
}
}
auto pixLeft = usex + (usew - _contentSize.width()) / 2;
auto pixTop = (minHeight() - _contentSize.height()) / 2;
if (QRect({ pixLeft, pixTop }, _contentSize).contains(point)) {
// Link of content can be nullptr (e.g. sticker without stickerpack).
// So we have to process it to avoid overriding the previous result.
if (_content->link()
&& QRect({ pixLeft, pixTop }, _contentSize).contains(point)) {
result.link = _content->link();
return result;
}