diff options
author | Neil <nyamatongwe@gmail.com> | 2014-05-03 13:30:18 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-05-03 13:30:18 +1000 |
commit | 9e90d41b58d6eafbf90a7435ea40c8c94e0aa1b1 (patch) | |
tree | c3e24e4e33c77abd593fc7f6d88f61c07c33d57b /src/ViewStyle.cxx | |
parent | 32cae5a3a2c79282abba21a07d60130f05d86cea (diff) | |
download | scintilla-mirror-9e90d41b58d6eafbf90a7435ea40c8c94e0aa1b1.tar.gz |
Using casts and an alternate PRectangle constructor to make XYPOSITION <-> int
conversions and other conversions more consistent.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r-- | src/ViewStyle.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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; |