mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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.
|
// Entry page is always a bubble bottom.
|
||||||
auto mediaOnBottom = (mediaDisplayed && media->isBubbleBottom()) || check || (entry/* && entry->isBubbleBottom()*/);
|
auto mediaOnBottom = (mediaDisplayed && media->isBubbleBottom()) || check || (entry/* && entry->isBubbleBottom()*/);
|
||||||
|
auto mediaOnTop = (mediaDisplayed && media->isBubbleTop()) || (entry && entry->isBubbleTop());
|
||||||
|
|
||||||
if (item->repliesAreComments() || item->externalReply()) {
|
if (item->repliesAreComments() || item->externalReply()) {
|
||||||
g.setHeight(g.height() - st::historyCommentsButtonHeight);
|
g.setHeight(g.height() - st::historyCommentsButtonHeight);
|
||||||
|
@ -2160,11 +2161,18 @@ PointState Message::pointState(QPoint point) const {
|
||||||
trect.setHeight(trect.height() - entryHeight);
|
trect.setHeight(trect.height() - entryHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mediaHeight = media->height();
|
const auto mediaHeight = mediaDisplayed ? media->height() : 0;
|
||||||
auto mediaLeft = trect.x() - st::msgPadding.left();
|
const auto mediaLeft = trect.x() - st::msgPadding.left();
|
||||||
auto mediaTop = (trect.y() + trect.height() - mediaHeight);
|
const auto mediaTop = (!mediaDisplayed || _invertMedia)
|
||||||
|
? (trect.y() + (mediaOnTop ? 0 : st::mediaInBubbleSkip))
|
||||||
if (point.y() >= mediaTop && point.y() < mediaTop + mediaHeight) {
|
: (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));
|
return media->pointState(point - QPoint(mediaLeft, mediaTop));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue