Text box selection doesn't have gaps between rectangles on different lines

This commit is contained in:
Yousef Khadadeh 2025-10-03 08:26:21 +03:00
parent dc7c4c37b6
commit cfe91411d7

View file

@ -482,7 +482,10 @@ void Editor::paint(SkCanvas* c, PaintOpts options) {
{
assert(pos.fParagraphIndex < fLines.size());
const TextParagraph& l = fLines[pos.fParagraphIndex];
c->drawRect(offset(l.fCursorPos[pos.fTextByteIndex], l.fOrigin), selection);
SkRect selectionRect = offset(l.fCursorPos[pos.fTextByteIndex], l.fOrigin);
if(pos.fParagraphIndex < fLines.size() - 1)
selectionRect.fBottom = fLines[pos.fParagraphIndex + 1].fOrigin.y();
c->drawRect(selectionRect, selection);
}
if(fLines.size() > 0)