Fix layout for RTL messages.

This commit is contained in:
John Preston
2026-04-17 10:53:20 +07:00
parent 66b38ccb5f
commit 5eed8136dd
@@ -2321,11 +2321,10 @@ void Message::paintText(
}); });
} }
const auto realWidth = textRealWidth();
auto highlightRequest = context.computeHighlightCache(); auto highlightRequest = context.computeHighlightCache();
text().draw(p, { text().draw(p, {
.position = trect.topLeft(), .position = trect.topLeft(),
.availableWidth = realWidth ? realWidth : trect.width(), .availableWidth = std::max(textRealWidth(), trect.width()),
.palette = &stm->textPalette, .palette = &stm->textPalette,
.pre = stm->preCache.get(), .pre = stm->preCache.get(),
.blockquote = context.quoteCache( .blockquote = context.quoteCache(
@@ -3644,7 +3643,7 @@ bool Message::getStateText(
if (base::in_range(point.y(), trect.y(), trect.y() + trect.height())) { if (base::in_range(point.y(), trect.y(), trect.y() + trect.height())) {
*outResult = TextState(item, text().getState( *outResult = TextState(item, text().getState(
point - trect.topLeft(), point - trect.topLeft(),
trect.width(), std::max(textRealWidth(), trect.width()),
request.forText())); request.forText()));
if (outResult->link if (outResult->link
&& IsRippleLink(outResult->link) && IsRippleLink(outResult->link)