diff options
author | Neil <nyamatongwe@gmail.com> | 2013-10-23 18:09:26 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-10-23 18:09:26 +1100 |
commit | 1fc86b17675485cd1c256183c89170102031ca60 (patch) | |
tree | ac09373673d6241628eb56ea9b907606660551a2 /src | |
parent | 1832faec49de51585c538d557a9c0225184ff674 (diff) | |
download | scintilla-mirror-1fc86b17675485cd1c256183c89170102031ca60.tar.gz |
Widen scroll width for annotations.
Diffstat (limited to 'src')
-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; |