diff options
| author | Zufu Liu <unknown> | 2025-12-22 09:04:53 +1100 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2025-12-22 09:04:53 +1100 |
| commit | cf2169f74a2ed05ee7f5d0c74436b8da32a8de1d (patch) | |
| tree | 8b1db153a159501027b3978a4a054abe7875a45e /src/ViewStyle.cxx | |
| parent | 6fbec94e04de1fe14351adb42564bfd17ceed2b2 (diff) | |
| download | scintilla-mirror-cf2169f74a2ed05ee7f5d0c74436b8da32a8de1d.tar.gz | |
Small optimization avoids retrieving font ascent twice.
Diffstat (limited to 'src/ViewStyle.cxx')
| -rw-r--r-- | src/ViewStyle.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 361b71d25..767e019f4 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -74,10 +74,11 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, Technology technolog // floor here is historical as platform layers have tweaked their values to match. // ceil would likely be better to ensure (nearly) all of the ink of a character is seen // but that would require platform layer changes. - measurements.ascent = std::floor(surface.Ascent(font.get())); + const XYPOSITION ascent = surface.Ascent(font.get()); + measurements.ascent = std::floor(ascent); measurements.descent = std::floor(surface.Descent(font.get())); - measurements.capitalHeight = surface.Ascent(font.get()) - surface.InternalLeading(font.get()); + measurements.capitalHeight = ascent - surface.InternalLeading(font.get()); measurements.aveCharWidth = surface.AverageCharWidth(font.get()); measurements.monospaceCharacterWidth = measurements.aveCharWidth; measurements.spaceWidth = surface.WidthText(font.get(), " "); |
