diff options
Diffstat (limited to 'src/scintilla_backports/6182_7c132e9340ce.patch')
-rw-r--r-- | src/scintilla_backports/6182_7c132e9340ce.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/scintilla_backports/6182_7c132e9340ce.patch b/src/scintilla_backports/6182_7c132e9340ce.patch new file mode 100644 index 00000000..4eaca03a --- /dev/null +++ b/src/scintilla_backports/6182_7c132e9340ce.patch @@ -0,0 +1,43 @@ +# HG changeset patch +# User Neil <nyamatongwe@gmail.com> +# Date 1491982645 -36000 +# Node ID 7c132e9340ce3425120c0c84820461d238f0560a +# Parent 75b60222c770944068ee3492a39e82a29c775da6 +For speed, store height of capital letters in FontMeasurements so not +recalculated for every character blob. + +diff -r 75b60222c770 -r 7c132e9340ce src/EditView.cxx +--- a/src/EditView.cxx Tue Apr 11 18:11:18 2017 +1000 ++++ b/src/EditView.cxx Wed Apr 12 17:37:25 2017 +1000 +@@ -818,8 +818,7 @@ + surface->FillRectangle(rcSegment, textBack); + } + FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font; +- int normalCharHeight = static_cast<int>(surface->Ascent(ctrlCharsFont) - +- surface->InternalLeading(ctrlCharsFont)); ++ const int normalCharHeight = static_cast<int>(ceil(vsDraw.styles[STYLE_CONTROLCHAR].capitalHeight)); + PRectangle rcCChar = rcSegment; + rcCChar.left = rcCChar.left + 1; + rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight; +diff -r 75b60222c770 -r 7c132e9340ce src/Style.h +--- a/src/Style.h Tue Apr 11 18:11:18 2017 +1000 ++++ b/src/Style.h Wed Apr 12 17:37:25 2017 +1000 +@@ -46,6 +46,7 @@ + struct FontMeasurements { + unsigned int ascent; + unsigned int descent; ++ XYPOSITION capitalHeight; // Top of capital letter to baseline: ascent - internal leading + XYPOSITION aveCharWidth; + XYPOSITION spaceWidth; + int sizeZoomed; +diff -r 75b60222c770 -r 7c132e9340ce src/ViewStyle.cxx +--- a/src/ViewStyle.cxx Tue Apr 11 18:11:18 2017 +1000 ++++ b/src/ViewStyle.cxx Wed Apr 12 17:37:25 2017 +1000 +@@ -86,6 +86,7 @@ + + ascent = static_cast<unsigned int>(surface.Ascent(font)); + descent = static_cast<unsigned int>(surface.Descent(font)); ++ capitalHeight = surface.Ascent(font) - surface.InternalLeading(font); + aveCharWidth = surface.AverageCharWidth(font); + spaceWidth = surface.WidthChar(font, ' '); + } |