[LyX/master] Use correct width for \fint
Enrico Forestieri
forenr at lyx.org
Tue Sep 8 18:11:11 UTC 2020
On Tue, Sep 08, 2020 at 01:41:57PM -0400, Scott Kostyshak wrote:
>
> This commit changes some spacing of an integral limit. See the attached
> .lyx file and screenshots for before/after. In particular, the spacing
> around '\in', ':', and '\le' is reduced.
Please, try the attached patch.
--
Enrico
-------------- next part --------------
diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index 361125056e..0f4c14adc5 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -246,9 +246,12 @@ int GuiFontMetrics::width(docstring const & s) const
bool const math_char = s.length() == 1;
#endif
if (math_char) {
+ QString const qs = toqstr(s);
+ int br_width = metrics_.boundingRect(qs).width();
+ int s_width = metrics_.width(qs);
// keep value 0 for math chars with width 0
- if (metrics_.width(toqstr(s)) != 0)
- w = metrics_.boundingRect(toqstr(s)).width();
+ if (s_width != 0)
+ w = max(br_width, s_width);
} else {
QTextLayout tl;
tl.setText(toqstr(s));
More information about the lyx-devel
mailing list