jcs
/textview
/amendments
/73
TVDrawMatch: Properly account for tv->scrolled.left
jcs made amendment 73 about 1 month ago
--- tv_draw.c Wed Oct 14 16:44:47 2026
+++ tv_draw.c Wed Oct 14 17:43:15 2026
@@ -337,11 +337,11 @@ TVDrawMatch(struct TVRec *tv, struct TVFindInRectMatch
EraseRect(&r);
}
- MoveTo(match->rect.left, tv->scrolled.top + match->rect.bottom -
- match->line->baseline);
+ MoveTo(tv->scrolled.left + match->rect.left,
+ tv->scrolled.top + match->rect.bottom - match->line->baseline);
if (match->style->bitmap_data_size) {
r = match->style->bitmap.bounds;
- r.left = match->rect.left;
+ r.left = tv->scrolled.left + match->rect.left;
r.right = r.left + (match->style->bitmap.bounds.right -
match->style->bitmap.bounds.left);
r.bottom = tv->scrolled.top + match->line->rect.bottom;
@@ -362,7 +362,8 @@ TVDrawMatch(struct TVRec *tv, struct TVFindInRectMatch
DrawText(spanstart, 0, text - spanstart);
GetPen(&pen);
next_tabstop = pen.h + TVCharWidth(tv, match->style,
- match->line, pen.h - match->line->indent, '\t');
+ match->line, pen.h - tv->scrolled.left -
+ match->line->indent, '\t');
#if 0
/* draw dotted lines for tabs */
/* XXX: disabled for now but might be useful as an option */