From 46e54d394dfd76a0d3055850ce8e6f394dfe2ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Ni=C3=9Fl?= Date: Fri, 22 Jul 2022 21:11:33 +1000 Subject: Bug [#2341] Stop including STYLE_CALLTIP when calculating line height. --- doc/ScintillaHistory.html | 5 +++++ src/ViewStyle.cxx | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index fb3a45cc8..5d30b807a 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -593,6 +593,11 @@ Bug #2338.
  • + Stop including STYLE_CALLTIP when calculating line height. + Allows a large font to be used for calltips without affecting text display. + Bug #2341. +
  • +
  • Fix incorrect display of selection when printing in some modes. Bug #2335.
  • diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 44ca8e59b..25a5f9cad 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -711,10 +711,15 @@ FontRealised *ViewStyle::Find(const FontSpecification &fs) { } void ViewStyle::FindMaxAscentDescent() noexcept { - for (const auto &font : fonts) { - if (maxAscent < font.second->measurements.ascent) - maxAscent = font.second->measurements.ascent; - if (maxDescent < font.second->measurements.descent) - maxDescent = font.second->measurements.descent; + for (size_t i = 0; i < styles.size(); i++) { + if (i == StyleCallTip) + continue; + + const auto &style = styles[i]; + + if (maxAscent < style.ascent) + maxAscent = style.ascent; + if (maxDescent < style.descent) + maxDescent = style.descent; } } -- cgit v1.2.3