From 5f94fa24a0c808ce4ddbadc7d7884786f9c0a15f Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 30 Dec 2021 15:19:45 +0300 Subject: [PATCH] Some fixes in spoiler geometry. --- ui/text/text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 198a153..22fde20 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -1767,7 +1767,7 @@ private: } if (_background.color) { const auto from = currentBlock->from(); - const auto to = currentBlock->from() + currentBlock->width(); + const auto to = (nextBlock ? nextBlock->from() : _t->_text.size()); if (_localFrom + si.position < to) { auto chFrom = _str + currentBlock->from(); auto chTo = chFrom + ((nextBlock ? nextBlock->from() : _t->_text.size()) - currentBlock->from()); @@ -1781,7 +1781,7 @@ private: if (rtl) { // rtl space only fillSpoiler = { x, glyphX - x }; } else { // ltr space only - fillSpoiler = { x + currentBlock->f_width(), si.width }; + fillSpoiler = { x + currentBlock->f_width(), si.width - currentBlock->f_width() }; } } } @@ -1995,7 +1995,7 @@ private: if (fillOpacity != opacity) { _p->setOpacity(fillOpacity); } - fillSpoilerRange(x, si.width, blockIndex); + fillSpoilerRange(x, itemWidth, blockIndex); _p->setOpacity(opacity); } }