Commit dfd2c5db authored by mae's avatar mae

small block highlighting cleanup for the no-wrapping case with overlong lines

parent a180345b
......@@ -1746,11 +1746,11 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), blendColor);
}
// keep right margin clean from full-width selection
int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width())
- doc->documentMargin();
er.setRight(qMin(er.right(), maxX));
painter.setClipRect(er);
// // keep right margin clean from full-width selection
// int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width())
// - doc->documentMargin();
// er.setRight(qMin(er.right(), maxX));
// painter.setClipRect(er);
bool editable = !isReadOnly();
......@@ -1804,9 +1804,11 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
int count = d->m_highlightBlocksInfo.visualIndent.size();
if (count) {
QRectF rr = r;
rr.setWidth(viewport()->width());
for(int i = 0; i <= depth; ++i) {
int vi = i > 0 ? d->m_highlightBlocksInfo.visualIndent.at(i-1) : 0;
painter.fillRect(r.adjusted(vi, 0, 0, 0), calcBlendColor(baseColor, count - i));
painter.fillRect(rr.adjusted(vi, 0, -8*i, 0), calcBlendColor(baseColor, count - i));
}
}
}
......
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