From df60ea0a4ca15e7fcaad38b47cd8cf4cd642e68c Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 22 Jun 2014 13:16:57 +1000 Subject: Always use the passed ViewStyle instead of the global one as this can cause problems when printing. --- src/Editor.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 49fa40910..d0f30b05d 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2692,9 +2692,9 @@ void Editor::DrawIndicators(Surface *surface, const ViewStyle &vsDraw, int line, } // Use indicators to highlight matching braces - if ((vs.braceHighlightIndicatorSet && (bracesMatchStyle == STYLE_BRACELIGHT)) || - (vs.braceBadLightIndicatorSet && (bracesMatchStyle == STYLE_BRACEBAD))) { - int braceIndicator = (bracesMatchStyle == STYLE_BRACELIGHT) ? vs.braceHighlightIndicator : vs.braceBadLightIndicator; + if ((vsDraw.braceHighlightIndicatorSet && (bracesMatchStyle == STYLE_BRACELIGHT)) || + (vsDraw.braceBadLightIndicatorSet && (bracesMatchStyle == STYLE_BRACEBAD))) { + int braceIndicator = (bracesMatchStyle == STYLE_BRACELIGHT) ? vsDraw.braceHighlightIndicator : vsDraw.braceBadLightIndicator; if (under == vsDraw.indicators[braceIndicator].under) { Range rangeLine(posLineStart + lineStart, posLineEnd); if (rangeLine.ContainsCharacter(braces[0])) { @@ -2722,15 +2722,15 @@ void Editor::DrawAnnotation(Surface *surface, const ViewStyle &vsDraw, int line, if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) { surface->FillRectangle(rcSegment, vsDraw.styles[0].back); rcSegment.left = static_cast(xStart); - if (trackLineWidth || (vs.annotationVisible == ANNOTATION_BOXED)) { + if (trackLineWidth || (vsDraw.annotationVisible == ANNOTATION_BOXED)) { // Only care about calculating width if tracking or need to draw box int widthAnnotation = WidestLineWidth(surface, vsDraw, vsDraw.annotationStyleOffset, stAnnotation); - if (vs.annotationVisible == ANNOTATION_BOXED) { + if (vsDraw.annotationVisible == ANNOTATION_BOXED) { widthAnnotation += static_cast(vsDraw.spaceWidth * 2); // Margins } if (widthAnnotation > lineWidthMaxSeen) lineWidthMaxSeen = widthAnnotation; - if (vs.annotationVisible == ANNOTATION_BOXED) { + if (vsDraw.annotationVisible == ANNOTATION_BOXED) { rcSegment.left = static_cast(xStart + indent); rcSegment.right = rcSegment.left + widthAnnotation; } @@ -2745,14 +2745,14 @@ void Editor::DrawAnnotation(Surface *surface, const ViewStyle &vsDraw, int line, lineInAnnotation++; } PRectangle rcText = rcSegment; - if (vs.annotationVisible == ANNOTATION_BOXED) { + if (vsDraw.annotationVisible == ANNOTATION_BOXED) { surface->FillRectangle(rcText, vsDraw.styles[stAnnotation.StyleAt(start) + vsDraw.annotationStyleOffset].back); rcText.left += vsDraw.spaceWidth; } DrawStyledText(surface, vsDraw, vsDraw.annotationStyleOffset, rcText, static_cast(rcText.top + vsDraw.maxAscent), stAnnotation, start, lengthAnnotation); - if (vs.annotationVisible == ANNOTATION_BOXED) { + if (vsDraw.annotationVisible == ANNOTATION_BOXED) { surface->PenColour(vsDraw.styles[vsDraw.annotationStyleOffset].fore); surface->MoveTo(static_cast(rcSegment.left), static_cast(rcSegment.top)); surface->LineTo(static_cast(rcSegment.left), static_cast(rcSegment.bottom)); @@ -3097,8 +3097,8 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l } PRectangle rcDot(xmid + xStart - static_cast(subLineStart), rcSegment.top + vsDraw.lineHeight / 2, 0.0f, 0.0f); - rcDot.right = rcDot.left + vs.whitespaceSize; - rcDot.bottom = rcDot.top + vs.whitespaceSize; + rcDot.right = rcDot.left + vsDraw.whitespaceSize; + rcDot.bottom = rcDot.top + vsDraw.whitespaceSize; surface->FillRectangle(rcDot, textFore); } } -- cgit v1.2.3