From 6d6af0efa9e927f5b6094f9592e46242d2c1fc3b Mon Sep 17 00:00:00 2001 From: John Levon Date: Sat, 7 Sep 2002 20:00:39 +0000 Subject: [PATCH] revert accurate per-char metrics git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5224 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/qfont_metrics.C | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 1681a7c392..b586c03529 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2002-09-07 John Levon + + * qfont_metrics.C: revert accurate per-char metrics + because LyX is broken + 2002-09-07 John Levon * qfont_loader.h: diff --git a/src/frontends/qt2/qfont_metrics.C b/src/frontends/qt2/qfont_metrics.C index 8d6f0000d2..9853d8f432 100644 --- a/src/frontends/qt2/qfont_metrics.C +++ b/src/frontends/qt2/qfont_metrics.C @@ -43,17 +43,29 @@ int maxDescent(LyXFont const & f) } -int ascent(char c, LyXFont const & f) +int ascent(char /*c*/, LyXFont const & f) { +// LyX is broken - returning accurate metrics breaks mathed +// because the cursor extends outside of its region. +// http://marc.theaimsgroup.com/?l=lyx-devel&m=103060206211300&w=2 +#if 0 QRect r = metrics(f).boundingRect(c); return abs(r.top()); +#endif + return metrics(f).ascent(); } -int descent(char c, LyXFont const & f) +int descent(char /*c*/, LyXFont const & f) { +// LyX is broken - returning accurate metrics breaks mathed +// because the cursor extends outside of its region. +// http://marc.theaimsgroup.com/?l=lyx-devel&m=103060206211300&w=2 +#if 0 QRect r = metrics(f).boundingRect(c); return abs(r.bottom()); +#endif + return metrics(f).descent(); }