diff options
-rw-r--r-- | include/Platform.h | 4 | ||||
-rw-r--r-- | src/CallTip.cxx | 8 | ||||
-rw-r--r-- | src/Editor.cxx | 7 | ||||
-rw-r--r-- | src/Indicator.cxx | 2 | ||||
-rw-r--r-- | src/LineMarker.cxx | 4 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 8 | ||||
-rw-r--r-- | src/XPM.cxx | 6 |
7 files changed, 22 insertions, 17 deletions
diff --git a/include/Platform.h b/include/Platform.h index 138eb8a75..5f8c2f2a1 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -126,6 +126,10 @@ public: PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) : left(left_), top(top_), right(right_), bottom(bottom_) { } + PRectangle(int left_, int top_, int right_, int bottom_) : + left(static_cast<XYPOSITION>(left_)), top(static_cast<XYPOSITION>(top_)), + right(static_cast<XYPOSITION>(right_)), bottom(static_cast<XYPOSITION>(bottom_)) { + } // Other automatically defined methods (assignment, copy constructor, destructor) are fine diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 04ae6c593..804bb9769 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -165,9 +165,9 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, int CallTip::PaintContents(Surface *surfaceWindow, bool draw) { PRectangle rcClientPos = wCallTip.GetClientPosition(); - PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left, + PRectangle rcClientSize(0.0f, 0.0f, rcClientPos.right - rcClientPos.left, rcClientPos.bottom - rcClientPos.top); - PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1); + PRectangle rcClient(1.0f, 1.0f, rcClientSize.right - 1, rcClientSize.bottom - 1); // To make a nice small call tip window, it is only sized to fit most normal characters without accents int ascent = RoundXYPosition(surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font)); @@ -218,9 +218,9 @@ void CallTip::PaintCT(Surface *surfaceWindow) { if (val.empty()) return; PRectangle rcClientPos = wCallTip.GetClientPosition(); - PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left, + PRectangle rcClientSize(0.0f, 0.0f, rcClientPos.right - rcClientPos.left, rcClientPos.bottom - rcClientPos.top); - PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1); + PRectangle rcClient(1.0f, 1.0f, rcClientSize.right - 1, rcClientSize.bottom - 1); surfaceWindow->FillRectangle(rcClient, colourBG); diff --git a/src/Editor.cxx b/src/Editor.cxx index e96588023..946e0fe2b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2423,7 +2423,7 @@ ColourDesired Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground, void Editor::DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight) { Point from(0, ((lineVisible & 1) && (lineHeight & 1)) ? 1 : 0); - PRectangle rcCopyArea(start + 1, rcSegment.top, start + 2, rcSegment.bottom); + PRectangle rcCopyArea(start + 1, static_cast<int>(rcSegment.top), start + 2, static_cast<int>(rcSegment.bottom)); surface->Copy(rcCopyArea, from, highlight ? *pixmapIndentGuideHighlight : *pixmapIndentGuide); } @@ -3124,7 +3124,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis rcSegment.bottom); surface->FillRectangle(rcSpace, textBack); } - PRectangle rcDot(xmid + xStart - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0, 0); + PRectangle rcDot(xmid + xStart - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0.0f, 0.0f); rcDot.right = rcDot.left + vs.whitespaceSize; rcDot.bottom = rcDot.top + vs.whitespaceSize; surface->FillRectangle(rcDot, textFore); @@ -3705,7 +3705,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { if (bufferedDraw) { Point from(vs.textStart-leftTextOverlap, 0); PRectangle rcCopyArea(vs.textStart-leftTextOverlap, yposScreen, - rcClient.right - vs.rightMarginWidth, yposScreen + vs.lineHeight); + static_cast<int>(rcClient.right - vs.rightMarginWidth), + yposScreen + vs.lineHeight); surfaceWindow->Copy(rcCopyArea, from, *pixmapLine); } diff --git a/src/Indicator.cxx b/src/Indicator.cxx index ac7435156..45dccc8e2 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -20,7 +20,7 @@ using namespace Scintilla; static PRectangle PixelGridAlign(const PRectangle &rc) { // Move left and right side to nearest pixel to avoid blurry visuals - return PRectangle(int(rc.left + 0.5), rc.top, int(rc.right + 0.5), rc.bottom); + return PRectangle(int(rc.left + 0.5), int(rc.top), int(rc.right + 0.5), int(rc.bottom)); } void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) { diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index dec359a91..3bf671b6e 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -344,11 +344,11 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac character, 1, fore, back); } else if (markType == SC_MARK_DOTDOTDOT) { - int right = centreX - 6; + XYPOSITION right = static_cast<XYPOSITION>(centreX - 6); for (int b=0; b<3; b++) { PRectangle rcBlob(right, rc.bottom - 4, right + 2, rc.bottom-2); surface->FillRectangle(rcBlob, fore); - right += 5; + right += 5.0f; } } else if (markType == SC_MARK_ARROWS) { surface->PenColour(fore); diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index b1c9dc10b..af808f3c1 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -75,12 +75,12 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, cons if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1 sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER; - float deviceHeight = surface.DeviceHeightFont(sizeZoomed); + float deviceHeight = static_cast<float>(surface.DeviceHeightFont(sizeZoomed)); FontParameters fp(fs.fontName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, fs.weight, fs.italic, fs.extraFontFlag, technology, fs.characterSet); font.Create(fp); - ascent = surface.Ascent(font); - descent = surface.Descent(font); + ascent = static_cast<unsigned int>(surface.Ascent(font)); + descent = static_cast<unsigned int>(surface.Descent(font)); aveCharWidth = surface.AverageCharWidth(font); spaceWidth = surface.WidthChar(font, ' '); } @@ -347,7 +347,7 @@ void ViewStyle::Refresh(Surface &surface, int tabInChars) { controlCharWidth = 0.0; if (controlCharSymbol >= 32) { - controlCharWidth = surface.WidthChar(styles[STYLE_CONTROLCHAR].font, controlCharSymbol); + controlCharWidth = surface.WidthChar(styles[STYLE_CONTROLCHAR].font, static_cast<char>(controlCharSymbol)); } fixedColumnWidth = marginInside ? leftMarginWidth : 0; diff --git a/src/XPM.cxx b/src/XPM.cxx index e1d91846d..b3c9b338f 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -109,7 +109,7 @@ void XPM::Init(const char *const *linesForm) { if (*colourDef == '#') { colour.Set(colourDef); } else { - codeTransparent = code; + codeTransparent = static_cast<char>(code); } colourCodeTable[code] = colour; } @@ -127,8 +127,8 @@ void XPM::Draw(Surface *surface, PRectangle &rc) { return; } // Centre the pixmap - int startY = rc.top + (rc.Height() - height) / 2; - int startX = rc.left + (rc.Width() - width) / 2; + int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); + int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); for (int y=0; y<height; y++) { int prevCode = 0; int xStartRun = 0; |