Commit 9bef75f8 authored by mae's avatar mae
Browse files

fixed repaint issue with collapse-popups

parent d50cc220
......@@ -2293,13 +2293,13 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
qreal blockHeight = 0;
QTextBlock b = visibleCollapsedBlock;
while (!b.isVisible() && visibleCollapsedBlockOffset.y() + blockHeight <= e->rect().bottom()) {
while (!b.isVisible()) {
b.setVisible(true); // make sure block bounding rect works
QRectF r = blockBoundingRect(b).translated(visibleCollapsedBlockOffset);
QTextLayout *layout = b.layout();
for (int i = layout->lineCount()-1; i >= 0; --i)
maxWidth = qMax(maxWidth, layout->lineAt(i).naturalTextWidth() + margin);
maxWidth = qMax(maxWidth, layout->lineAt(i).naturalTextWidth() + 2*margin);
blockHeight += r.height();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment