aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-08-26 10:48:18 +0000
committernyamatongwe <unknown>2009-08-26 10:48:18 +0000
commit275e0c25ae6cf1568099509682417b1c8ae60911 (patch)
tree1d4a17c53614d85917a198b948d6d96e174c7c8a /src/Editor.cxx
parent8e9c1647b1620be3e44d59d6429c68ed46010017 (diff)
downloadscintilla-mirror-275e0c25ae6cf1568099509682417b1c8ae60911.tar.gz
Avoid breaking text into substrings on selection boundaries for drawing
when the selection is empty (thus only needing a caret drawn) or when the selection settings do not need the text drawn as pieces such as when the selection is drawn translucently.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 9f50e331d..2d438e8db 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2600,11 +2600,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
}
+ bool selBackDrawn = vsDraw.selbackset &&
+ ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA));
+
// Does not take margin into account but not significant
int xStartVisible = subLineStart - xStart;
ll->psel = &sel;
- BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, IsUnicodeMode(), xStartVisible);
+
+ BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, IsUnicodeMode(), xStartVisible, selBackDrawn);
int next = bfBack.First();
// Background drawing loop
@@ -2694,7 +2698,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
inIndentation = subLine == 0; // Do not handle indentation except on first subline.
// Foreground drawing loop
- BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, IsUnicodeMode(), xStartVisible);
+ BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, IsUnicodeMode(), xStartVisible,
+ ((!twoPhaseDraw && selBackDrawn) || vsDraw.selforeset));
next = bfFore.First();
while (next < lineEnd) {