text->top_y(y);
- drawFromTo(text, bv, 0, owner_.height(), 0, 0);
+ // not needed in the xforms frontend anymore
+ //drawFromTo(text, bv, 0, owner_.height(), 0, 0);
repaint();
owner_.getPainter().end();
/// our buffer's default layout font
LyXFont defaultfont_;
private:
- /** the 'anchor' row: the position of this row remains constant
- * with respect to the top of the screen
- */
- RowList::iterator anchor_row_;
- /** the pixel offset with respect to this row of top_y
- */
- int anchor_row_offset_;
+ /// offset of dran area to document start.
+ int anchor_y_;
public:
/// update all cached row positions
void updateRowPositions();
int LyXText::top_y() const
{
- if (anchor_row_ == endRow())
- return 0;
-
- return anchor_row_->y() + anchor_row_offset_;
+ return anchor_y_;
}
if (ownerParagraphs().begin()->rows.empty())
return;
- if (isInInset()) {
- anchor_row_ = firstRow();
- anchor_row_offset_ = newy;
- return;
- }
-
- lyxerr[Debug::GUI] << "setting top y = " << newy << endl;
-
- int y = newy;
- ParagraphList::iterator dummypit;
- anchor_row_ = getRowNearY(y, dummypit);
- anchor_row_offset_ = newy - y;
- lyxerr[Debug::GUI] << "changing reference to row: " << &*anchor_row_
- << " offset: " << anchor_row_offset_ << endl;
-}
-
-
-void LyXText::anchor_row(RowList::iterator rit)
-{
- int old_y = top_y();
- anchor_row_offset_ = 0;
- anchor_row_ = rit;
- anchor_row_offset_ = old_y - top_y();
- lyxerr[Debug::GUI] << "anchor_row(): changing reference to row: "
- << &*anchor_row_ << " offset: "
- << anchor_row_offset_ << endl;
+ anchor_y_ = newy;
+ lyxerr[Debug::GUI] << "changing reference to offset: " << anchor_y_ << endl;
}
LyXText::LyXText(BufferView * bv)
- : height(0), width(0), anchor_row_offset_(0),
+ : height(0), width(0), anchor_y_(0),
inset_owner(0), the_locking_inset(0), bv_owner(bv)
-{
- anchor_row_ = endRow();
-}
+{}
LyXText::LyXText(BufferView * bv, InsetText * inset)
- : height(0), width(0), anchor_row_offset_(0),
+ : height(0), width(0), anchor_y_(0),
inset_owner(inset), the_locking_inset(0), bv_owner(bv)
-{
- anchor_row_ = endRow();
-}
+{}
void LyXText::init(BufferView * bview)
width = 0;
height = 0;
- anchor_row_ = endRow();
- anchor_row_offset_ = 0;
+ anchor_y_ = 0;
current_font = getFont(beg, 0);
RowList::iterator end = pit->rows.end();
// remove rows of paragraph
- int anchor_cnt = -1;
- for (int i = 0; rit != end; ++rit, ++i) {
- if (rit == anchor_row_)
- anchor_cnt = i;
+ for (int i = 0; rit != end; ++rit, ++i)
height -= rit->height();
- }
+
pit->rows.clear();
// rebreak the paragraph
setHeightOfRow(pit, tmprow);
}
- if (anchor_cnt == -1) {
- if (anchor_cnt >= pit->rows.size())
- anchor_cnt = pit->rows.size();
- anchor_row_ = pit->rows.begin();
- advance(anchor_row_, anchor_cnt);
- }
-
//lyxerr << "redoParagraph: " << pit->rows.size() << " rows\n";
}
width = 0;
height = 0;
- anchor_row_ = endRow();
- anchor_row_offset_ = 0;
+ //anchor_y_ = 0;
ParagraphList::iterator pit = ownerParagraphs().begin();
ParagraphList::iterator end = ownerParagraphs().end();