From 43566e4211e18057662ff5d8c8d3996b73090d43 Mon Sep 17 00:00:00 2001 From: mitchell Date: Fri, 25 May 2018 13:33:38 -0400 Subject: Backport: Modernize Platform.h (3) - update Surface to delete WidthChar, use size_t for Polygon and delete the standard copy and assignment methods. Backport of changeset 6940:89fd29243232. --- src/ViewStyle.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index d57ad48bd..2b87c8a51 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -79,7 +79,7 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, cons descent = static_cast(surface.Descent(font)); capitalHeight = surface.Ascent(font) - surface.InternalLeading(font); aveCharWidth = surface.AverageCharWidth(font); - spaceWidth = surface.WidthChar(font, ' '); + spaceWidth = surface.WidthText(font, " ", 1); } ViewStyle::ViewStyle() : markers(MARKER_MAX + 1), indicators(INDIC_MAX + 1) { @@ -365,7 +365,8 @@ void ViewStyle::Refresh(Surface &surface, int tabInChars) { controlCharWidth = 0.0; if (controlCharSymbol >= 32) { - controlCharWidth = surface.WidthChar(styles[STYLE_CONTROLCHAR].font, static_cast(controlCharSymbol)); + const char cc[2] = { static_cast(controlCharSymbol), '\0' }; + controlCharWidth = surface.WidthText(styles[STYLE_CONTROLCHAR].font, cc, 1); } CalculateMarginWidthAndMask(); -- cgit v1.2.3