Slightly optimized repaint of text in messages when it is out of clip.

This commit is contained in:
23rd
2025-12-29 20:10:59 +03:00
parent e4a16e7e83
commit 8638d26156
@@ -1860,7 +1860,6 @@ void Message::paintText(
const auto stm = context.messageStyle();
p.setPen(stm->historyTextFg);
p.setFont(st::msgFont);
prepareCustomEmojiPaint(p, context, text());
if (const auto botTop = Get<FakeBotAboutTop>()) {
botTop->text.drawLeftElided(
p,
@@ -1870,6 +1869,10 @@ void Message::paintText(
width());
trect.setY(trect.y() + botTop->height);
}
if (!context.clip.intersects(trect)) {
return;
}
prepareCustomEmojiPaint(p, context, text());
auto highlightRequest = context.computeHighlightCache();
text().draw(p, {
.position = trect.topLeft(),