From 9e90d41b58d6eafbf90a7435ea40c8c94e0aa1b1 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 3 May 2014 13:30:18 +1000 Subject: Using casts and an alternate PRectangle constructor to make XYPOSITION <-> int conversions and other conversions more consistent. --- src/ViewStyle.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ViewStyle.cxx') 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(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(surface.Ascent(font)); + descent = static_cast(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(controlCharSymbol)); } fixedColumnWidth = marginInside ? leftMarginWidth : 0; -- cgit v1.2.3