From 997becee99fae9c846a95b43d4488e3def41b229 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 2 Nov 2010 20:29:18 +1100 Subject: Change creation of stippled pixmaps to use FillRectangle calls rather than LineTo to avoid blurry images when using an antialiased drawing library like Cairo. --- src/Editor.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 46080557e..1d2e2ac9a 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3165,11 +3165,11 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) { } pixmapSelPattern->FillRectangle(rcPattern, colourFMFill); - pixmapSelPattern->PenColour(colourFMStripes); - for (int stripe = 0; stripe < patternSize; stripe++) { - // Alternating 1 pixel stripes is same as checkerboard. - pixmapSelPattern->MoveTo(0, stripe * 2); - pixmapSelPattern->LineTo(patternSize, stripe * 2 - patternSize); + for (int y = 0; y < patternSize; y++) { + for (int x = y % 2; x < patternSize; x+=2) { + PRectangle rcPixel(x, y, x+1, y+1); + pixmapSelPattern->FillRectangle(rcPixel, colourFMStripes); + } } } @@ -3183,10 +3183,9 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) { pixmapIndentGuideHighlight->FillRectangle(rcIG, vs.styles[STYLE_BRACELIGHT].back.allocated); pixmapIndentGuideHighlight->PenColour(vs.styles[STYLE_BRACELIGHT].fore.allocated); for (int stripe = 1; stripe < vs.lineHeight + 1; stripe += 2) { - pixmapIndentGuide->MoveTo(0, stripe); - pixmapIndentGuide->LineTo(2, stripe); - pixmapIndentGuideHighlight->MoveTo(0, stripe); - pixmapIndentGuideHighlight->LineTo(2, stripe); + PRectangle rcPixel(0, stripe, 1, stripe+1); + pixmapIndentGuide->FillRectangle(rcPixel, vs.styles[STYLE_INDENTGUIDE].fore.allocated); + pixmapIndentGuideHighlight->FillRectangle(rcPixel, vs.styles[STYLE_BRACELIGHT].fore.allocated); } } -- cgit v1.2.3