From e850a69bf1a4fc7dfe3d859bec611bdaafd4115e Mon Sep 17 00:00:00 2001 From: John Levon Date: Sat, 14 Sep 2002 04:50:38 +0000 Subject: [PATCH] fix rbearing git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5302 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/qfont_metrics.C | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 6f1fe14caf..379bc78215 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-09-14 John Levon + + * qfont_metrics.C: fix rbearing() + 2002-09-14 John Levon * QLPainter.C: fix arc diff --git a/src/frontends/qt2/qfont_metrics.C b/src/frontends/qt2/qfont_metrics.C index 5f3963c386..ae8fc18a18 100644 --- a/src/frontends/qt2/qfont_metrics.C +++ b/src/frontends/qt2/qfont_metrics.C @@ -59,13 +59,17 @@ int descent(char c, LyXFont const & f) int lbearing(char c, LyXFont const & f) { + lyxerr << "lb of " << c << " is " << metrics(f).leftBearing(c) << endl; return metrics(f).leftBearing(c); } int rbearing(char c, LyXFont const & f) { - return metrics(f).rightBearing(c); + QFontMetrics const & m(metrics(f)); + + // Qt rbearing is from the right edge of the char's width(). + return (m.width(c) - m.rightBearing(c)); }