Fix an incorrect text bounding rectangle calculation inside the sidebar

Authored by AndreyYashkin on Aug 7 2019, 10:14 PM.

Description

Fix an incorrect text bounding rectangle calculation inside the sidebar

Summary:
Now fontBoundaries always has smaller width than boundingRect from

void QPainter::drawText(const QRect &rectangle, int flags, const QString &text, QRect *boundingRect = nullptr)

which is required to enclose the whole text. The difference is only several pixels, but sometimes it can cause visual problems. You can see the sidebar without and with this patch in Russian language with Noto Sans 10pt font on a picture below.


Now the first and the last symbols are fully visible.

Reviewers: Okular

Subscribers: okular-devel

Tags: Okular

Differential Revision: https://phabricator.kde.org/D23012

Details