mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Fix point state detection on media messages.
This commit is contained in:
parent
0445f7d6e8
commit
a4212cc865
1 changed files with 13 additions and 5 deletions
|
@ -2120,6 +2120,7 @@ PointState Message::pointState(QPoint point) const {
|
|||
|
||||
// Entry page is always a bubble bottom.
|
||||
auto mediaOnBottom = (mediaDisplayed && media->isBubbleBottom()) || check || (entry/* && entry->isBubbleBottom()*/);
|
||||
auto mediaOnTop = (mediaDisplayed && media->isBubbleTop()) || (entry && entry->isBubbleTop());
|
||||
|
||||
if (item->repliesAreComments() || item->externalReply()) {
|
||||
g.setHeight(g.height() - st::historyCommentsButtonHeight);
|
||||
|
@ -2160,11 +2161,18 @@ PointState Message::pointState(QPoint point) const {
|
|||
trect.setHeight(trect.height() - entryHeight);
|
||||
}
|
||||
|
||||
auto mediaHeight = media->height();
|
||||
auto mediaLeft = trect.x() - st::msgPadding.left();
|
||||
auto mediaTop = (trect.y() + trect.height() - mediaHeight);
|
||||
|
||||
if (point.y() >= mediaTop && point.y() < mediaTop + mediaHeight) {
|
||||
const auto mediaHeight = mediaDisplayed ? media->height() : 0;
|
||||
const auto mediaLeft = trect.x() - st::msgPadding.left();
|
||||
const auto mediaTop = (!mediaDisplayed || _invertMedia)
|
||||
? (trect.y() + (mediaOnTop ? 0 : st::mediaInBubbleSkip))
|
||||
: (trect.y() + trect.height() - mediaHeight);
|
||||
if (mediaDisplayed && _invertMedia) {
|
||||
trect.setY(mediaTop
|
||||
+ mediaHeight
|
||||
+ (mediaOnBottom ? 0 : st::mediaInBubbleSkip));
|
||||
}
|
||||
if (point.y() >= mediaTop
|
||||
&& point.y() < mediaTop + mediaHeight) {
|
||||
return media->pointState(point - QPoint(mediaLeft, mediaTop));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue