diff options
author | nyamatongwe <unknown> | 2003-02-14 23:27:23 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-02-14 23:27:23 +0000 |
commit | 5309c307bb45d02cfe12e99eaa18f64ab76b7455 (patch) | |
tree | f49a35ac8145359229277b41a7cf6df9bf5b4ddd | |
parent | a45d62bb26c51974033011099f0e349cba9db00b (diff) | |
download | scintilla-mirror-5309c307bb45d02cfe12e99eaa18f64ab76b7455.tar.gz |
Cleaned up the fold margin code a bit.
-rw-r--r-- | src/Editor.cxx | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 6cb5f6aa9..990429db9 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2213,20 +2213,24 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis void Editor::RefreshPixMaps(Surface *surfaceWindow) { if (!pixmapSelPattern->Initialised()) { - pixmapSelPattern->InitPixMap(8, 8, surfaceWindow); - // This complex procedure is to reproduce the checker board dithered pattern used by windows + const int patternSize=8; + pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow); + // This complex procedure is to reproduce the checkerboard dithered pattern used by windows // for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half // way between the chrome colour and the chrome highlight colour making a nice transition // between the window chrome and the content area. And it works in low colour depths. - PRectangle rcPattern(0, 0, 8, 8); + PRectangle rcPattern(0, 0, patternSize, patternSize); - // Default to highlight edge colour in case unusual colour scheme chosen + // Initialize default colours based on the chrome colour scheme. Typically the highlight is white. ColourAllocated colourFMFill = vs.selbar.allocated; ColourAllocated colourFMStripes = vs.selbarlight.allocated; - if (!(vs.selbarlight.desired == ColourDesired(0xff, 0xff, 0xff))) { + + if (!(vs.selbarlight.desired == ColourDesired(0xff, 0xff, 0xff))) { // User has chosen an unusual chrome colour scheme so just use the highlight edge colour. - colourFMFill = vs.selbarlight.allocated; - } + // (Typically, the highlight colour is white.) + colourFMFill = vs.selbarlight.allocated; + } + if (vs.foldmarginColourSet) { // override default fold margin colour colourFMFill = vs.foldmarginColour.allocated; @@ -2238,9 +2242,10 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) { pixmapSelPattern->FillRectangle(rcPattern, colourFMFill); pixmapSelPattern->PenColour(colourFMStripes); - for (int stripe = 0; stripe < 8; stripe++) { + for (int stripe = 0; stripe < patternSize; stripe++) { + // Alternating 1 pixel stripes is same as checkerboard. pixmapSelPattern->MoveTo(0, stripe * 2); - pixmapSelPattern->LineTo(8, stripe * 2 - 8); + pixmapSelPattern->LineTo(patternSize, stripe * 2 - patternSize); } } |