sourceforge.net

Scintilla / Bugs / #2320 Wrong EOL annotation position

  • ️Thu Mar 31 2022

Bug in Scintilla EditView::DrawEOLAnnotationText()

When showing a fold display text the EOL annotation is drawn at the wrong position. The problem is caused if both elements use different fonts (see attached image).

Solution: Use fold display text font (instead of EOL annotation font) to calculate the width of the fold display text.

Bug fix in EditView::DrawEOLAnnotationText():

// replace:
rcSegment.left += (static_cast<int>(
surface->WidthText(fontText, foldDisplayText)) + vsDraw.aveCharWidth);
// by
rcSegment.left += (static_cast<int>(
surface->WidthText(vsDraw.styles[StyleFoldDisplayText].font.get(),foldDisplayText))
+ vsDraw.aveCharWidth);