add comments and remove dead code from revision 19721.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19726 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-22 14:44:34 +00:00
parent 7e6d5cb553
commit 65e16cdb27

View File

@ -489,27 +489,21 @@ int BufferView::workWidth() const
void BufferView::updateOffsetRef()
{
// No need to update offset_ref_ in this case.
if (!need_centering_)
return;
// We are not properly started yet, delay until resizing is
// done.
if (height_ == 0)
return;
CursorSlice & bot = cursor_.bottom();
TextMetrics & tm = text_metrics_[bot.text()];
pit_type const pit = bot.pit();
ParagraphMetrics const & pm = tm.parMetrics(pit);
anchor_ref_ = pit;
//DocIterator dit;
//dit.push_back(bot);
//dit.pos() = 0;
ParagraphMetrics const & pm = tm.parMetrics(bot.pit());
Point p = bv_funcs::coordOffset(*this, cursor_, cursor_.boundary());
offset_ref_ = p.y_ + pm.ascent() - height_ / 2;
lyxerr << "p.y_ " << p.y_ << " pm.ascent() " << pm.ascent() << " h/2 " << height_/2
<< " offset_ref_ " << offset_ref_ << endl;
need_centering_ = false;
}