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 | 5a909b1c029b406ce1297a0595ab87cd5370b820 (patch) | |
tree | 20e8a54b2278fedae79e54a44507e5db90af5522 /src | |
parent | 1a52270d01ba0ca45c39daa2cd480e3e6b99b2d9 (diff) | |
download | scintilla-mirror-5a909b1c029b406ce1297a0595ab87cd5370b820.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; |