Fix fast share button hover area.

This commit is contained in:
John Preston 2018-02-18 16:22:58 +03:00
parent 49d2c97ceb
commit ddab8c1473
1 changed files with 16 additions and 13 deletions

View File

@ -716,6 +716,7 @@ TextState Message::textState(
} }
if (drawBubble()) { if (drawBubble()) {
const auto inBubble = g.contains(point);
auto entry = logEntryOriginal(); auto entry = logEntryOriginal();
auto mediaDisplayed = media && media->isDisplayed(); auto mediaDisplayed = media && media->isDisplayed();
@ -729,7 +730,7 @@ TextState Message::textState(
} }
if (mediaOnTop) { if (mediaOnTop) {
trect.setY(trect.y() - st::msgPadding.top()); trect.setY(trect.y() - st::msgPadding.top());
} else { } else if (inBubble) {
if (getStateFromName(point, trect, &result)) { if (getStateFromName(point, trect, &result)) {
return result; return result;
} }
@ -769,6 +770,7 @@ TextState Message::textState(
result.cursor = CursorState::Date; result.cursor = CursorState::Date;
} }
}; };
if (inBubble) {
if (mediaDisplayed) { if (mediaDisplayed) {
auto mediaHeight = media->height(); auto mediaHeight = media->height();
auto mediaLeft = trect.x() - st::msgPadding.left(); auto mediaLeft = trect.x() - st::msgPadding.left();
@ -789,6 +791,7 @@ TextState Message::textState(
} else if (point.y() >= trect.y() + trect.height()) { } else if (point.y() >= trect.y() + trect.height()) {
result.symbol = item->_text.length(); result.symbol = item->_text.length();
} }
}
checkForPointInTime(); checkForPointInTime();
if (displayRightAction()) { if (displayRightAction()) {
const auto fastShareSkip = snap( const auto fastShareSkip = snap(