summaryrefslogtreecommitdiffstats
path: root/scintilla/src
diff options
context:
space:
mode:
Diffstat (limited to 'scintilla/src')
-rw-r--r--scintilla/src/Editor.cxx19
-rw-r--r--scintilla/src/LineMarker.cxx10
-rw-r--r--scintilla/src/Style.h2
3 files changed, 21 insertions, 10 deletions
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index e900982..185d730 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -1947,8 +1947,8 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
}
PRectangle rcNumber = rcMarker;
// Right justify
- int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
- int xpos = rcNumber.right - width - 3;
+ XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
+ XYPOSITION xpos = rcNumber.right - width - 3;
rcNumber.left = xpos;
surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,
rcNumber.top + vs.maxAscent, number, istrlen(number),
@@ -3532,6 +3532,9 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
}
PLATFORM_ASSERT(pixmapSelPattern->Initialised());
+ if (!bufferedDraw)
+ surfaceWindow->SetClip(rcArea);
+
if (paintState != paintAbandoned) {
PaintSelMargin(surfaceWindow, rcArea);
@@ -3577,10 +3580,12 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
// Remove selection margin from drawing area so text will not be drawn
// on it in unbuffered mode.
- PRectangle rcTextArea = rcClient;
- rcTextArea.left = vs.fixedColumnWidth;
- rcTextArea.right -= vs.rightMarginWidth;
- surfaceWindow->SetClip(rcTextArea);
+ if (!bufferedDraw) {
+ PRectangle rcTextArea = rcClient;
+ rcTextArea.left = vs.fixedColumnWidth;
+ rcTextArea.right -= vs.rightMarginWidth;
+ surfaceWindow->SetClip(rcTextArea);
+ }
// Loop on visible lines
//double durLayout = 0.0;
@@ -3665,7 +3670,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
if (bufferedDraw) {
Point from(vs.fixedColumnWidth, 0);
PRectangle rcCopyArea(vs.fixedColumnWidth, yposScreen,
- rcClient.right, yposScreen + vs.lineHeight);
+ rcClient.right - vs.rightMarginWidth, yposScreen + vs.lineHeight);
surfaceWindow->Copy(rcCopyArea, from, *pixmapLine);
}
diff --git a/scintilla/src/LineMarker.cxx b/scintilla/src/LineMarker.cxx
index 8162b2c..46f62bf 100644
--- a/scintilla/src/LineMarker.cxx
+++ b/scintilla/src/LineMarker.cxx
@@ -97,7 +97,13 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
return;
}
if ((markType == SC_MARK_RGBAIMAGE) && (image)) {
- surface->DrawRGBAImage(rcWhole, image->GetWidth(), image->GetHeight(), image->Pixels());
+ // Make rectangle just large enough to fit image centred on centre of rcWhole
+ PRectangle rcImage;
+ rcImage.top = static_cast<int>(((rcWhole.top + rcWhole.bottom) - image->GetHeight()) / 2);
+ rcImage.bottom = rcImage.top + image->GetHeight();
+ rcImage.left = static_cast<int>(((rcWhole.left + rcWhole.right) - image->GetWidth()) / 2);
+ rcImage.right = rcImage.left + image->GetWidth();
+ surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels());
return;
}
// Restrict most shapes a bit
@@ -332,7 +338,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
} else if (markType >= SC_MARK_CHARACTER) {
char character[1];
character[0] = static_cast<char>(markType - SC_MARK_CHARACTER);
- int width = surface->WidthText(fontForCharacter, character, 1);
+ XYPOSITION width = surface->WidthText(fontForCharacter, character, 1);
rc.left += (rc.Width() - width) / 2;
rc.right = rc.left + width;
surface->DrawTextClipped(rc, fontForCharacter, rc.bottom - 2,
diff --git a/scintilla/src/Style.h b/scintilla/src/Style.h
index 3657cae..211e234 100644
--- a/scintilla/src/Style.h
+++ b/scintilla/src/Style.h
@@ -47,7 +47,7 @@ struct FontMeasurements {
unsigned int ascent;
unsigned int descent;
unsigned int externalLeading;
- unsigned int aveCharWidth;
+ XYPOSITION aveCharWidth;
XYPOSITION spaceWidth;
int sizeZoomed;
FontMeasurements();