diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 8fda6b9ba..504c85b41 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2766,14 +2766,19 @@ void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int x const StyledText stAnnotation = pdoc->AnnotationStyledText(line); if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) { surface->FillRectangle(rcSegment, vsDraw.styles[0].back); - if (vs.annotationVisible == ANNOTATION_BOXED) { - // Only care about calculating width if need to draw box + rcSegment.left = xStart; + if (trackLineWidth || (vs.annotationVisible == ANNOTATION_BOXED)) { + // Only care about calculating width if tracking or need to draw box int widthAnnotation = WidestLineWidth(surface, vsDraw, vsDraw.annotationStyleOffset, stAnnotation); - widthAnnotation += vsDraw.spaceWidth * 2; // Margins - rcSegment.left = xStart + indent; - rcSegment.right = rcSegment.left + widthAnnotation; - } else { - rcSegment.left = xStart; + if (vs.annotationVisible == ANNOTATION_BOXED) { + widthAnnotation += vsDraw.spaceWidth * 2; // Margins + } + if (widthAnnotation > lineWidthMaxSeen) + lineWidthMaxSeen = widthAnnotation; + if (vs.annotationVisible == ANNOTATION_BOXED) { + rcSegment.left = xStart + indent; + rcSegment.right = rcSegment.left + widthAnnotation; + } } const int annotationLines = pdoc->AnnotationLines(line); size_t start = 0; |