Mueller, Joe
2013-10-10 06:05:51 UTC
Thanks for your reply Neil. Having to explicitly set the scroll width for annotations kind of defeats the purpose of turning on scroll width tracking.
I think the following modification to the 3.3.0 version of Editor.cxx solves the problem, if you agree, could you incorporate that into your next release?
2775a2776
< if (vs.annotationVisible == ANNOTATION_BOXED) {
---
< rcSegment.left = xStart + indent;
< rcSegment.right = rcSegment.left + widthAnnotation;
< } else {
< rcSegment.left = xStart;
---
void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine) {
int indent = pdoc->GetLineIndentation(line) * vsDraw.spaceWidth;
PRectangle rcSegment = rcLine;
int annotationLine = subLine - ll->lines;
const StyledText stAnnotation = pdoc->AnnotationStyledText(line);
rcSegment.left = xStart;
if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) {
surface->FillRectangle(rcSegment, vsDraw.styles[0].back);
if (trackLineWidth || (vs.annotationVisible == ANNOTATION_BOXED)) {
// Only care about calculating width if need to draw box
int widthAnnotation = WidestLineWidth(surface, vsDraw, vsDraw.annotationStyleOffset, stAnnotation);
widthAnnotation += vsDraw.spaceWidth * 2; // Margins
if (widthAnnotation > lineWidthMaxSeen)
lineWidthMaxSeen = widthAnnotation;
if ((vs.annotationVisible == ANNOTATION_BOXED)) {
rcSegment.left = xStart + indent;
rcSegment.right = rcSegment.left + widthAnnotation;
}
}
From: scintilla-***@googlegroups.com [mailto:scintilla-***@googlegroups.com]
Sent: Wednesday, October 09, 2013 5:58 PM
To: Digest Recipients
Subject: [scintilla] Digest for scintilla-***@googlegroups.com - 4 Messages in 2 Topics
Today's Topic Summary
Group: http://groups.google.com/group/scintilla-interest/topics
§ SCI_SETSCROLLWIDTHTRACKING and annotation lines [2 Updates]
§ Questions on colourising the background [2 Updates]
SCI_SETSCROLLWIDTHTRACKING and annotation lines<http://groups.google.com/group/scintilla-interest/t/6cf0ce5b10f56ce5>
"Mueller, Joe" <***@mentor.com<mailto:***@mentor.com>> Oct 09 11:08PM
I'm having trouble where I have set SCI_SETSCROLLWIDTHTRACKING on, but when adding an annotation line that's larger than the text in the document, the horizontal scroll bar width isn't expanded to allow viewing of the entire annotation line. Is this a known problem?
Joe
Neil
I think the following modification to the 3.3.0 version of Editor.cxx solves the problem, if you agree, could you incorporate that into your next release?
2775a2776
rcSegment.left = xStart;
2778c2779< if (vs.annotationVisible == ANNOTATION_BOXED) {
---
if (trackLineWidth || (vs.annotationVisible == ANNOTATION_BOXED)) {
2782,2785c2783,2788< rcSegment.left = xStart + indent;
< rcSegment.right = rcSegment.left + widthAnnotation;
< } else {
< rcSegment.left = xStart;
---
if (widthAnnotation > lineWidthMaxSeen)
lineWidthMaxSeen = widthAnnotation;
if ((vs.annotationVisible == ANNOTATION_BOXED)) {
rcSegment.left = xStart + indent;
rcSegment.right = rcSegment.left + widthAnnotation;
}
Or if the diff input is difficult to use, here's the relevant piece of code:lineWidthMaxSeen = widthAnnotation;
if ((vs.annotationVisible == ANNOTATION_BOXED)) {
rcSegment.left = xStart + indent;
rcSegment.right = rcSegment.left + widthAnnotation;
}
void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine) {
int indent = pdoc->GetLineIndentation(line) * vsDraw.spaceWidth;
PRectangle rcSegment = rcLine;
int annotationLine = subLine - ll->lines;
const StyledText stAnnotation = pdoc->AnnotationStyledText(line);
rcSegment.left = xStart;
if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) {
surface->FillRectangle(rcSegment, vsDraw.styles[0].back);
if (trackLineWidth || (vs.annotationVisible == ANNOTATION_BOXED)) {
// Only care about calculating width if need to draw box
int widthAnnotation = WidestLineWidth(surface, vsDraw, vsDraw.annotationStyleOffset, stAnnotation);
widthAnnotation += vsDraw.spaceWidth * 2; // Margins
if (widthAnnotation > lineWidthMaxSeen)
lineWidthMaxSeen = widthAnnotation;
if ((vs.annotationVisible == ANNOTATION_BOXED)) {
rcSegment.left = xStart + indent;
rcSegment.right = rcSegment.left + widthAnnotation;
}
}
From: scintilla-***@googlegroups.com [mailto:scintilla-***@googlegroups.com]
Sent: Wednesday, October 09, 2013 5:58 PM
To: Digest Recipients
Subject: [scintilla] Digest for scintilla-***@googlegroups.com - 4 Messages in 2 Topics
Today's Topic Summary
Group: http://groups.google.com/group/scintilla-interest/topics
§ SCI_SETSCROLLWIDTHTRACKING and annotation lines [2 Updates]
§ Questions on colourising the background [2 Updates]
SCI_SETSCROLLWIDTHTRACKING and annotation lines<http://groups.google.com/group/scintilla-interest/t/6cf0ce5b10f56ce5>
"Mueller, Joe" <***@mentor.com<mailto:***@mentor.com>> Oct 09 11:08PM
I'm having trouble where I have set SCI_SETSCROLLWIDTHTRACKING on, but when adding an annotation line that's larger than the text in the document, the horizontal scroll bar width isn't expanded to allow viewing of the entire annotation line. Is this a known problem?
Joe
I'm having trouble where I have set SCI_SETSCROLLWIDTHTRACKING on, but when adding an annotation line that's larger than the text in the document, the horizontal scroll bar width isn't expanded to allow viewing of the entire annotation line. Is this a known problem?
Its not something that was taken into account when implementing annotations. Applications can increase the scroll width when setting an annotation if they want.Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.