mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
used pre-computed metrics a bit more...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7269 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7e5c4e7695
commit
cf319aa81c
@ -1,3 +1,8 @@
|
||||
|
||||
2003-07-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* insettext.[Ch]: used cached metrics a bit more
|
||||
|
||||
2003-07-10 Alfredo Brauntein <abraunst@libero.it>
|
||||
|
||||
* insettabular.[Ch]: invalidate InsetTabular::view(), added buffer()
|
||||
|
@ -274,10 +274,10 @@ void InsetText::read(Buffer const * buf, LyXLex & lex)
|
||||
void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
BufferView * bv = mi.base.bv;
|
||||
LyXText * text = getLyXText(bv);
|
||||
dim.asc = text->rows().begin()->ascent_of_text() + TEXT_TO_INSET_OFFSET;
|
||||
dim.des = text->height - dim.asc + TEXT_TO_INSET_OFFSET;
|
||||
dim.wid = max(textWidth(bv), int(text->width)) + 2 * TEXT_TO_INSET_OFFSET;
|
||||
setViewCache(bv);
|
||||
dim.asc = text_.rows().begin()->ascent_of_text() + TEXT_TO_INSET_OFFSET;
|
||||
dim.des = text_.height - dim.asc + TEXT_TO_INSET_OFFSET;
|
||||
dim.wid = max(textWidth(bv), int(text_.width)) + 2 * TEXT_TO_INSET_OFFSET;
|
||||
dim.wid = max(dim.wid, 10);
|
||||
dim_ = dim;
|
||||
}
|
||||
@ -1938,15 +1938,13 @@ int InsetText::cix(BufferView * bv) const
|
||||
|
||||
int InsetText::cy(BufferView * bv) const
|
||||
{
|
||||
LyXFont font;
|
||||
return text_.cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
|
||||
return text_.cursor.y() - dim_.asc + TEXT_TO_INSET_OFFSET;
|
||||
}
|
||||
|
||||
|
||||
int InsetText::ciy(BufferView * bv) const
|
||||
{
|
||||
LyXFont font;
|
||||
return text_.cursor.iy() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
|
||||
return text_.cursor.iy() - dim_.asc + TEXT_TO_INSET_OFFSET;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user