mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-10 21:53:50 +00:00
@@ -764,6 +764,7 @@ protected:
|
||||
[[nodiscard]] int textHeightFor(int textWidth) const;
|
||||
[[nodiscard]] int textRealWidth() const { return _textRealWidth; }
|
||||
void validateText();
|
||||
void invalidateTextSizeCache();
|
||||
void validateTextSkipBlock(bool has, int width, int height);
|
||||
void validateInlineKeyboard(HistoryMessageReplyMarkup *markup);
|
||||
|
||||
@@ -802,7 +803,6 @@ private:
|
||||
}
|
||||
|
||||
void refreshMedia(Element *replacing);
|
||||
void invalidateTextSizeCache();
|
||||
void setTextWithLinks(
|
||||
const TextWithEntities &text,
|
||||
const std::vector<ClickHandlerPtr> &links = {});
|
||||
|
||||
@@ -586,6 +586,12 @@ void Message::requestRichPageRelayout(QRect articleRect) {
|
||||
if (const auto rich = const_cast<Message*>(this)->richpage()) {
|
||||
rich->article.invalidateLayout();
|
||||
}
|
||||
// The article layout was just invalidated, but textHeightFor() caches by
|
||||
// _textWidth and would short-circuit when re-queried at the same (constant)
|
||||
// max width, leaving the bubble sized from a stale, now-zeroed
|
||||
// lastLayoutWidth(). Drop the text-size cache too so the article is really
|
||||
// laid out again, the same way blockquoteExpandChanged() does for quotes.
|
||||
invalidateTextSizeCache();
|
||||
setPendingResize();
|
||||
history()->owner().requestViewResize(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user