From c3c62cbb60d7f8b98a6b5752efad37f9ba70aad9 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 12 Apr 2017 17:37:25 +1000 Subject: For speed, store height of capital letters in FontMeasurements so not recalculated for every character blob. --- src/EditView.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/EditView.cxx') diff --git a/src/EditView.cxx b/src/EditView.cxx index d40ac51d8..50555b0a1 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -818,8 +818,7 @@ static void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle r surface->FillRectangle(rcSegment, textBack); } FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font; - int normalCharHeight = static_cast(surface->Ascent(ctrlCharsFont) - - surface->InternalLeading(ctrlCharsFont)); + const int normalCharHeight = static_cast(ceil(vsDraw.styles[STYLE_CONTROLCHAR].capitalHeight)); PRectangle rcCChar = rcSegment; rcCChar.left = rcCChar.left + 1; rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight; -- cgit v1.2.3