From 4d495b8d7c53551d40bfc2a850e9a05341767b08 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 23 Dec 2018 20:42:32 +0400 Subject: [PATCH] Fix votes count in RTL languages. --- .../SourceFiles/history/media/history_media_poll.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/media/history_media_poll.cpp b/Telegram/SourceFiles/history/media/history_media_poll.cpp index 5bc135b24..9e21c70a5 100644 --- a/Telegram/SourceFiles/history/media/history_media_poll.cpp +++ b/Telegram/SourceFiles/history/media/history_media_poll.cpp @@ -425,7 +425,14 @@ void HistoryPoll::draw(Painter &p, const QRect &r, TextSelection selection, Time if (!_totalVotesLabel.isEmpty()) { tshift += st::msgPadding.bottom(); p.setPen(regular); - _totalVotesLabel.drawLeftElided(p, padding.left(), tshift, paintw, width()); + _totalVotesLabel.drawLeftElided( + p, + padding.left(), + tshift, + std::min( + _totalVotesLabel.maxWidth(), + paintw - _parent->infoWidth()), + width()); } }