mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
Fix ascent()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5461 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e0660589c4
commit
5696dc3287
@ -1,3 +1,7 @@
|
||||
2002-10-21 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* qfont_metrics.C (ascent): Fix returned value.
|
||||
|
||||
2002-10-21 Philippe Elie <phil.el@wanadoo.fr>
|
||||
|
||||
* QContentPane.h:
|
||||
|
@ -46,28 +46,28 @@ int maxAscent(LyXFont const & f)
|
||||
|
||||
int maxDescent(LyXFont const & f)
|
||||
{
|
||||
return metrics(f).descent();
|
||||
return metrics(f).descent()+1;
|
||||
// We add 1 as the value returned by QT is different than X
|
||||
// See http://doc.trolltech.com/2.3/qfontmetrics.html#200b74
|
||||
}
|
||||
|
||||
|
||||
int ascent(char c, LyXFont const & f)
|
||||
{
|
||||
QRect r = metrics(f).boundingRect(c);
|
||||
return abs(r.top());
|
||||
return -r.top();
|
||||
}
|
||||
|
||||
|
||||
int descent(char c, LyXFont const & f)
|
||||
{
|
||||
QRect r = metrics(f).boundingRect(c);
|
||||
return abs(r.bottom());
|
||||
return r.bottom()+1;
|
||||
}
|
||||
|
||||
|
||||
int lbearing(char c, LyXFont const & f)
|
||||
{
|
||||
lyxerr << "lb of " << c << " is " << metrics(f).leftBearing(c)
|
||||
<< std::endl;
|
||||
return metrics(f).leftBearing(c);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user